For now, we will use cin cout from iostream library.
To use it, you have to write
#include<iostream>
Input
If you want your variable to store value from the input, example :
int a;
cin >> a;
or
int a,b;
cin >> a >> b;
Output
If you want to show something to screen, example :
int a = 5;
cout << a;
cout << a << endl;
cout << a;
endl is for new line.
So it will show :
55
5
To use it, you have to write
#include<iostream>
Input
If you want your variable to store value from the input, example :
int a;
cin >> a;
or
int a,b;
cin >> a >> b;
Output
If you want to show something to screen, example :
int a = 5;
cout << a;
cout << a << endl;
cout << a;
endl is for new line.
So it will show :
55
5
Komentar
Posting Komentar