1if (condition) {
2 // block of code to be executed if the condition is true
3}
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;
3int main(){
4 int eta;
5 cout<<"Ciao Utente inserisci la tua eta'! "<<"\n";
6 cin>>eta;
7 if(eta >= 18){
8 cout<<"Benvenuto al cinema!";
9 }
10}