Thursday, August 5, 2021

C++ Program to find greater number among three variable using nested if

C++ Program to find greater number among three variable using nested if

#include<iostream.h>

#include<conio.h>

void main()

{

 int a,b,c;

 clrscr();

 cout<<"\nEnter First Number: ";

 cin>>a;

 cout<<"\nEnter Second Number: ";

 cin>>a;

 cout<<"\nEnter Third Number: ";

 cin>>a;

 

  if(a>b)

  {

         if(a>c)

  {

 

          cout<<"\n a is greater";

  }

  else

  {

 

          cout<<"\n c is greater";

  }

 

 

  }

  else if(b>c)

  {

   cout<<"\n b is greater";

  }

  else

  {

   cout<<"\n c is greater";

  }

 getch();

}

   

No comments:

Post a Comment

JAC Board Computer || IIT 2025 || Introductory Information Technology || Class 10 || Practical Examination 2025

Marks Division HOE 30 Marks IT Application Report File 20 Marks Viva - Voce 10 Marks 1) Write an HTML code to generate a web p...