+ 2
Can anyone of you tell me about the difference between using cout cin and print or scanf?
and plzz also tell why and when to use them .
5 Answers
+ 1
cout is an object used to display the result to the output console.
cin is an object used to read from the input console.
Both cout and cin are objects of c++ <iostream> header files. specific to c++
printf() is a function defined to display the output to the output console with format specifier(%d, %l and so on).
scanf() is also a function defined to read the input from the input console with the format specifier as mentioned above.
Both Printf() and scanf() are defined inside the stdio.h header file.
We can use the printf and scanf function in C and C++ as well as c++ is extended from c.
0
cout is for show something for display and cin is for get a value for keyboard
print and scanf is the same but in another enviroment like java
0
cout and cin are used in c++ program
printf and scanf are used in c program
0
cin is advanced form of scanf.Here we dont use format specifiers.we directly use variable name ex:cin>>a;
cout is used to display the data...
0
printf and scanf are used in stdio.. they both are same. .but.. see the structure of c++ ..so we have to write cout and cin