- 1
How can we use cout & cin functions? Give the a suitable program.
6 Antworten
+ 2
#include <iostream>
using namespace std;
int main() {
string s;
int n;
cout << "Please type a word" << endl;
cin >> s;
cout << "You entered: " << s << endl;
cout << "Please type a number" << endl;
cin >> n;
cout << "You entered: " << n << endl;
return 0;
}
+ 1
cout ia used for giving output while cin is used to take input
+ 1
cout"<<" where u can print data to the user
cin">>" where u can get the input data from the user
0
cout is a command that is used to output compiled information on the screen
cin is used to feed in data into the compiler
0
you can use cout in a void function
0
simple cout is output and cin is input thats it.....