// C++ Source code
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
class flight
{
long flightCode;
char description[25];
public:
void addInfo()
{
cin>>flightCode;
gets(description);
}
void showInfo()
{
cout<<endl<<"*** OUTPUT ***"<<endl;
cout<<flightCode<<":"<<description<<endl;
}
};
void main()
{
flight f;
f.addInfo();
f.showInfo();
getch();
}
Welcome to my C++ Source Codes Page
*** OUTPUT ***
1234:Welcome to my C++ Source Codes Page
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
class flight
{
long flightCode;
char description[25];
public:
void addInfo()
{
cin>>flightCode;
gets(description);
}
void showInfo()
{
cout<<endl<<"*** OUTPUT ***"<<endl;
cout<<flightCode<<":"<<description<<endl;
}
};
void main()
{
flight f;
f.addInfo();
f.showInfo();
getch();
}
OUTPUT
1234.5678Welcome to my C++ Source Codes Page
*** OUTPUT ***
1234:Welcome to my C++ Source Codes Page
No comments:
Post a Comment