Nama : Deab Sina
NIM : 49012078
Jurusan : D4 TMD ITB Batch 6
This is video about: Looping
Link to this video:
Source Code:
// I want to tell you about if/else statement
#include <iostream>
using namespace std;
int main()
{
int score; // declare int virable score
cout<<"========================================"<<endl;
cout<<" if/else statement"<<endl;
cout<<"========================================"<<endl;
cout<<"Please insert score = ";
cin>>score;
cout<<"----------------------------------------"<<endl;
if ( score >=90 )
{
cout<<"You are grade A"<<endl;
}
else if ( score >=80 )
{
cout<<"You are grade B"<<endl;
}
else if ( score >=70 )
{
cout<<"You are grade C"<<endl;
}
else if ( score >=60 )
{
cout<<"You are grade D"<<endl;
}
else
{
cout<<"You are grade E"<<endl;
}
system("pause");
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int score; // declare int virable score
cout<<"========================================"<<endl;
cout<<" if/else statement"<<endl;
cout<<"========================================"<<endl;
cout<<"Please insert score = ";
cin>>score;
cout<<"----------------------------------------"<<endl;
if ( score >=90 )
{
cout<<"You are grade A"<<endl;
}
else if ( score >=80 )
{
cout<<"You are grade B"<<endl;
}
else if ( score >=70 )
{
cout<<"You are grade C"<<endl;
}
else if ( score >=60 )
{
cout<<"You are grade D"<<endl;
}
else
{
cout<<"You are grade E"<<endl;
}
system("pause");
return 0;
}