1 if( a == 10 ) {
2 cout << "Value of a is 10" << endl;
3 } else if( a == 20 ) {
4 // if else if condition is true
5 cout << "Value of a is 20" << endl;
6 }
1#include<iostream>
2using namespace std;
3
4int main()
5{
6 int grade;
7
8 cin >> grade;
9
10 if( grade >= 60 )
11 cout << "You Pass!" << endl;
12 else
13 cout << "You Fail..." << endl;
14
15 return 0;
16}
17
1#include<iostream>
2using namespace std;
3
4int main()
5{
6 int grade;
7
8 cin >> grade;
9
10 if( grade >= 60 )
11 {
12 cout << "You Pass!" << endl;
13 }
14 else
15 {
16 cout << "You Fail..." << endl;
17 }
18
19 return 0;
20}
21