Monday, June 30

KEYBOARD AND SCREEN INPUT AND OUTPUT OPERATORS


Hello friends........ In my previous post I have told you about the Features of IOSTREAM.H......
Today I am going to tell you about the basic input / output operators which are really very necessary for any C++ program......
(a) Cout : The cout is used to display an object onto the standard device , normally the video screen . The insertion operator << is used along with the cout stream.
The general syntax of cout stream is ........

"cout<< variable 1 << variable 2 <<.........<< variable n;"
for example......
int x=45;
float y=78.45;
cout << x << y ;
The output will be : 45 78.45
If you want to add space between the output results .... use "\t"
for above example output will be ...... on using "\t"
cout<< x <<\t<< y ;
output: 45 78.45

(b) Cin : The cin is use to read some information from keyboard...... for this extraction operator is used, which is >>....
The general syntax :
cin >> variable 1>> variable 2>>............>> variable n
A program based on above two concepts will be posted by me tomorrow...........

0 comments:

Followers

Archive

 

Money ,Entertainment and Education. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com