0
What Does cout<< in C++ Do?
C++
4 Respostas
+ 4
it print your data to console. if you are talking about cout.
+ 2
c out = Console Output. Utilized to write output to the console. cout is an object found in iostream.
Code:
int number = 1000000000;
cout << "Varun is " << number << " millenia old." << endl;
I first inject "Varun is " into cout. Then, I inject number. Next, I inject " millenia old." Finally, I inject endl, which prints a newline. The semicolon ends the statement.
This would write "Varun is 1000000000 years old." to the console.
+ 1
Okay
+ 1
cout is used to print the data on the screen..
example.
cout<<"hello";
//output : hello
Hello will print on the screen.
Assignment operator << is used to assign the value to cout and it will print on the screen.
Happy codding