+ 3
What is the difference between cout and print??
17 Respuestas
+ 6
both have the same functionality to display but 'cout' is used in c++ ,'print' is used in c
+ 4
cout is used in C++ to display whatever you want when print is used in python for the same purpose. Every programming language has different method for this for ex; Java ==> System.out.println(); System.out.printf(); etc...PHP ==>echo ""; print""; JS ==>window.alert () , document.write().
+ 4
1.cout is an object of iostream class
printf is an funtion of (stdio.h)
2. we need format specifiers in printf like %d , %c etc.. for printing integer , charters etc..
but not in cout
3. printf returns integer value i.e no. of charters inside " " for ex. int a=printf("abc"); // so a=3
but cout return address
+ 2
printf is used in c where as using object orientation to make c++ completely object oriented they defined printf inside ostream class and created an object named as cout to perform printing task on a console
+ 1
cout is a reserved word. print is not, in c++. cout is the standard function to write something on the standard OUTput (screen, nowadays, printer before). Formely print, tells a programm to print on printer, cout on the screen.
+ 1
1.cout is an object of iostream class and printf is an funtion of stdio.h
2. we need format specifiers in printf like %d , %c,%f etc.. for printing integer , charters etc..
but not in cout
3. printf returns integer value i.e no. of charters inside " " for ex. int a=printf("mrk"); // a=3
but cout return address
4. cout is a reserved word. print is not, in c++. cout is the standard function to write something on the standard OUTput (screen, nowadays, printer before). Formely print, tells a programm to print on printer, cout on the screen
0
I have told the same na!!@rahul
0
we use print when we are using header file <stdioh>, and we use cout when we use header file <iostream>
0
the cout is the word for sow a output and print use for multiple text
0
both are same for display msg and output but cout an object in c++ and printf() is a function in c programming cout use with tha insertion operator <<
0
I am learning c++ using printf statement
- 1
Guyz printf is used in c but both printf and cout both can we used in c++ the main difference is printf is s function whereas cout is an object of some class whose I have froget but this is the main difference.
- 1
both do same work but cout is use for object and print used in c
- 2
both is used to print the value but 'print ' used in c and 'cout' used in c++
- 2
cout is an output statement in c++ programming language while print is just a statement used when writing pseudocodes for and it becomes an output statement in C when it is written as printf.
- 2
both tasks is same but difference is cout is used in c++ n print is used in c .
- 2
bella zii