Prog 7: Write a program to find
max. value from three values by using nested if-else.
#include<iostrea
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
cout<<"enter the
value of a:";
cin>>a;
cout<<"enter the
value of b:";
cin>>b;
cout<<"enter the
value of c:";
cin>>c;
if(a>b)
{
if(a>c)
cout<<"a is max.";
else
}
else
{
if(b>c)
else
cout<<"c is max.";
getch();
}
Output:
enter the value of a:11
enter the value of b:12 enter the value of c:13 c is max.
No comments:
Post a Comment