+ 1
Help me with this
when we print sum in c program we do it like printf{"sum is %d",sum}; how to do the same in c++
3 Answers
+ 2
If you like C syntax you can include stdio.h or cstdio as well
If you are asking for C++ style there are iostream std object cout for output and cin for input.
#include <stdio.h>
#include <iostream>
using namespace std;
...
printf("sum is %d", sum);
cout << "sum is " << sum;
+ 2
cout << "sum is " << sum << endl;



