Multiple if else Statement in C++

Master C++ with Real-time Projects and Kickstart Your Career Start Now!!

Program 1

// Program for Nested if else
#include<iostream>
#define clrscr() system("cls")
using namespace std;
int main()
{
     int a,b,c;
     cout<<"Enter three number";
     cin>>a>>b>>c;
     if(a>b && a>c) 
        cout<<"Grater number is "<<a;
     else
     if(b>c)   
        cout<<"Grater number is "<<b;
     else
      cout<<"Grater number is "<<c;  





   //Program for Word format
    //  if(n==1)
    //    cout<<"One";
    // else   
    // if(n==2)
    //    cout<<"Two";   
    // else   
    //   if(n==3)
    //    cout<<"Three";   
    //  else  
    //  if(n==4)
    //    cout<<"Four";   
    // else   
    // if(n==5)
    //   cout<<"Five";      
    // else  
    //   cout<<"Invalid Number";


    //Program for Vowel
    //   char ch;
    //   cout<<"Enter a character";
    //   cin>>ch;
    //   if(ch=='a' || ch=='A')
    //     cout<<"Vowel";
    //   else
    //      if(ch=='e' || ch=='E')
    //     cout<<"Vowel";   
    //   else
    //      if(ch=='i' || ch=='I')
    //     cout<<"Vowel";     
    //   else
    //      if(ch=='o' || ch=='O')
    //     cout<<"Vowel";     
    //   else
    //      if(ch=='u' || ch=='U')
    //     cout<<"Vowel";     
    //     else
    //     cout<<"Consonent";     
    return 0;
}

 

We work very hard to provide you quality material
Could you take 15 seconds and share your happy experience on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *