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

Programmingway@Eklavya Technosys!: JAC Board Computer Examination Sample Questions Hi...

Programmingway@Eklavya Technosys!: JAC Board Computer Examination Sample Questions Hi... : 1) Which of the following is NOT a web service? (...