answersLogoWhite

0

Answer:

Difference between "cin" & "cout" is:

"cout"

"cin"It stands for console output. Console means the computer display screen. The 'cout' is a predefined object. It is used as an output statement to display output on the computer screen. It I a part of iostream header file.

Flow of data from one location to another location is called stream .The 'cout' is the standard output stream.

The syntax of 'cout' is;

cout<< const1/vari1,.........................;

cout name of output stream object.

<< put to operator or insertion operator. It directs the output to the output device.

const1/var1, These are the constants and variables that are used to show output on the screen.

For e.g.

cout<<"one kilobyte="<<1024<<" bytes";

In above example two string constants, one numeric constant and three put to operators are used and its output will be: One kilobyte= 1024 bytes.

It stands for console input. It is an input stream. It is used as input statement to get input from the keyboard during execution of the program.

When an input statement is executed, the computer waits to receive an input from the keyboard. When the value is typed and enter key is pressed the value is assigned to the variable and control shifts to next statement.

It is also the part of iostream header file.

The syntax of 'cin' is:

cin>>var1 [>>var2...];

cin represents the object used as an input stream and gets the value from keyboard.

>> Extraction operator or get from operator. Its get an input from the input device and assigned t the variable.

var1, var2 represents list of variables and each variable I separated by '>>'

At least one variable on the right-hand-side of the ">>"operator must be used.

For e.g.

cin>>a>>b>>c;

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How you can use two input in a single statement in c plus plus?

cout&lt;&lt;"______": cin &gt;&gt;__&gt;&gt;__; [example cout&lt;&lt;"enter no."; cin&gt;&gt;a&gt;&gt;b; ]


What is the Logic to print the letters from A to Z without using printf in Turbo C plus plus?

#include&lt;iostream&gt; int main() { using namespace std; char c='A'; do { cout&lt;&lt;c; }while(c++&lt;'Z'); cout&lt;&lt;endl; }


What is the syntax of printing a value in c plus plus?

std::cout&lt;&lt;42&lt;&lt;std::endl;


How can write the name in c plus plus language without using cout statement?

I believe, you can use C-function - printf().


What is the C plus plus plus program for the addition of two numbers?

#include&lt;iostream&gt; int main() { int num1, num2; std::cout &lt;&lt; "C++ addition program" &lt;&lt; std::endl; std::cout &lt;&lt; "Enter a number: "; std::cin &gt;&gt; num1; std::cout &lt;&lt; "Enter another number: "; std::cin &gt;&gt; num2; std::cout &lt;&lt; "The sum is " &lt;&lt; num1 + num2 &lt;&lt; std::endl; }


What are the steps in c plus plus program to print word computer?

std::cout&lt;&lt;"computer"&lt;&lt;std::endl;


C plus plus code that determine prime number?

#include &lt;iostream.h&gt; main() { int a; cout&lt;&lt;"enter a number : "; cin&gt;&gt;a; cout&lt;&lt;endl; if (a%2-1) cout&lt;&lt;"it is a prime number"; else cout&lt;&lt;"it is not a prime number" return 0; } ------------------------------------------ output: enter a number : 30 it is a not a prime number


How can you write your name on c plus plus turbo v3.0?

#include&lt;iostream&gt; int main() { std::cout &lt;&lt; "Your name"; }


How do you say Hello World in C plus plus?

#include&lt;iostream&gt; in main() { std::cout &lt;&lt; "Hello World\n"; }


Example of Fibonacci in c plus plus?

#include&lt;iostream&gt; int main() { int x=0, y=1; std::cout&lt;&lt;x&lt;&lt;" "; std::cout&lt;&lt;y&lt;&lt;" "; while( y&lt;1000000 ) { std::cout&lt;&lt;(y+=x)&lt;&lt;" "; x=y-x; } std::cout&lt;&lt;std::endl; return(0); }


Fibonacci c plus plus program?

#include&lt;iostream&gt; int main() { int x=0, y=1; std::cout&lt;&lt;x&lt;&lt;" "; std::cout&lt;&lt;y&lt;&lt;" "; while( y&lt;1000000 ) { std::cout&lt;&lt;(y+=x)&lt;&lt;" "; x=y-x; } std::cout&lt;&lt;std::endl; return(0); }


Write a program for addition in c plus plus?

#include#includemain(){clrscr();coutb;cout