Skip to main content

Input & Output In C++ (Basic)


Cout<<”Print sentence”;    This statement is use to print out any kinds of sentence or string type values.

Cout<<345;    This statement is use to print out any kinds of numeric numbers, without change.

Cout<<variable;       This statement is use to print the value of variable. The value of the which variable we want to print, It is need to write that variable on variable place.

 


cin>> a;   cin is the standard input for c++ programming. any kinds of value can receive by using this statement. The benefit c++ from other language as like as java is this point.   


char ca;
int in;
string ss;
float fl;
double db;
cin>>ca;
cin>>in;
cin>>ss;
cin>>fl;
cin>>db;

Click hare download source code. 

Popular posts from this blog

Switch, Case, Default Statements In C++

Switch case is uses as alternative of if….else. When we need to use long term of if…else then we use switch case for reducing program execution time. syntax: Switch(variable){ Case value 1: Statement; Break; Case value 2: Statement; Break;

do...while loop in C++

The do while loop is very similar to while loop . In the while loop first check final condition then execute the statement. But in the do while loop first execute the statement then check the final condition. Syntax: Initialization; Do{ increment/decrement;   } while(Final condition)