0
Whats the difference?
#include "stdio.h" #include <iostream> using namespace std; void main() { printf("Hi\n"); cout<<"Its a test"<<endl; return 0; } what's the difference between printf and cout? both of them prints statement....
2 Réponses
+ 3
printf and cout are both used for displaying. printf is used in C. and cout is used in c++. since c++ is developed based on C, printf is also supported in c++
+ 2
Printf is a method which uses cout. It's just meant to give an easier syntax for printing, since it automatically adds the -cout <<- and -<< endl- parts. Printf is used in C, while cout is used in C++.