Cin, cout-regarding!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Cin, cout-regarding!!

can you compare the terms of cin,count and printf,scanf in c,c++ respectivelly?!!

24th Aug 2017, 2:16 AM
Darwin
Darwin - avatar
6 Answers
+ 9
cin is an object of istream used to manipulate standard input stream. cout is an object of ostream used to manipulate standard output stream. Both cin and cout objects are provided by including iostream header (which includes both istream and ostream). printf() is a function used to print text to the console screen. scanf() is used to read input from the user and store said input into variables. These functions are provided by stdio.h/cstdio header. While the former and the latter are both used for similar purposes, cout and cin can only be used in C++ (and is considered the standard way) while printf() and scanf() can be used in both C and C++ (but may not be considered safe, e.g. https://stackoverflow.com/questions/2430303/disadvantages-of-scanf#answer-2430978 )
24th Aug 2017, 2:24 AM
Hatsy Rei
Hatsy Rei - avatar
+ 2
cin and cout are generally used in c++ while printf and scanf can be used in both c and c++. cin and scanf will take the input from user and if you need to print the results you can use cout or printf.. cin is called console input while cout is called consolve output
24th Aug 2017, 2:52 AM
Sreejith P
Sreejith P - avatar
+ 1
thank u very much.....!!!?🙂🙂
24th Aug 2017, 2:26 AM
Darwin
Darwin - avatar
0
anyone
24th Aug 2017, 2:16 AM
Darwin
Darwin - avatar
0
yo
24th Aug 2017, 3:07 AM
‎ ‏‏‎Anonymous Guy
0
then how can we store the value using cin object?!
24th Aug 2017, 12:43 PM
Darwin
Darwin - avatar