We have already know variables and Input/Output.
Now we can make many simple program.
For example :
#include<iostream>
using namespace std;
int main(){
cout << "Put your name : ";
string name;
cin >> name;
cout << "Hello, " << name;
}
using namespace std is something like shortcut to use many library, included iostream.
Without it you have to use std::cin for cin and etc.
For now, put all your code inside int main.
Now we can make many simple program.
For example :
#include<iostream>
using namespace std;
int main(){
cout << "Put your name : ";
string name;
cin >> name;
cout << "Hello, " << name;
}
using namespace std is something like shortcut to use many library, included iostream.
Without it you have to use std::cin for cin and etc.
For now, put all your code inside int main.
Komentar
Posting Komentar