Tuesday, June 23, 2009

Console input and output streams



NOTE : -
THIS CONTENT IS NOT ORIGINAL

3. Console input and output streams

Input from the keyboard and output to the screen can be performed through
cout << and cin >>:


using namespace std;
#include

int main()
{
int a; // a is an integer variable
char s [100]; // s points to a string of max 99 characters

cout << "This is a sample program." << endl;

cout << endl; // Just a line feed (end of line)

cout << "Type your age : ";
cin >> a;

cout << "Type your name: ";
cin >> s;

cout << endl;

cout << "Hello " << s << " you're " << a << " old." << endl;
cout << endl << endl << "Bye!" << endl;

return 0;
}

Output
This is a sample program.

Type your age : 12
Type your name: Edmond

Hello Edmond you're 12 old.


Bye!




BIBILOGRAPHY / REFERENCE : - http://www.4p8.com/eric.brasseur/cppcen.html

No comments:

3G S

JAIL BREAK

iPHONE

BILL GATES

StEvE JoBs

steve jobs

STEVE JOBS

Steve Jobs

Love Country

SD

Burroughs

Lift

Joseph Johnson

Apple Rainbow

Apple Blue

Apple Laser Printer