+ 2
I donāt know whatās wrong
3 Answers
+ 7
Your code:
#include <iostream>
using namespace std;
int main() {
cout >> "hello humans";
return 0;
}
//use <<
cout<<"hello humans";
<< is used with cout
>> is used with cin
<< is stream insertion operator that insert content (variable , constant) on it's right side to specified stream.
>> is stream extraction operator that extract data from specified stream and store it in variable.
+ 5
Patrick Allsop
You are welcome ^^
nd use this trick to remember in beginning.
cin is object of standard input stream . (For a while remember it as your keyboard from which you give input)
cout is object of standard outputs stream. (Remember as console screen on which you get output)
<< >> these arrows can actually help you determine direction of data. The tip of arrow shows where the data goes and another end tells you from where data comes.
cin>>myvar;
//data comes from keyboard (cin) goes to myvar.
cout<<myvar;
//data is in myvar, and it goes to output screen (cout)
Hope it helps =)
Wish you good luck ..
+ 1
Thank you very much for the help I will be sure to remember