Ladder statement
Find the largest Numnber:-
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c;
cout<<"Enter any three number:"<<endl;
cin>>a>>b>>c;
if(a>=b && a>=c)
cout<<"a is largest number:"<<a<<endl;
else if(b>=a && b>=c)
cout<<"b is largest number:"<<b<<endl;
else
cout<<"c is largest number:"<<c<<endl;
getch();
}
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c;
cout<<"Enter any three number:"<<endl;
cin>>a>>b>>c;
if(a>=b && a>=c)
cout<<"a is largest number:"<<a<<endl;
else if(b>=a && b>=c)
cout<<"b is largest number:"<<b<<endl;
else
cout<<"c is largest number:"<<c<<endl;
getch();
}
Post a Comment