a program for max of three numbers in c.

 

 

 

 

 

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c,max=0;
printf(“Enter the value of a\n”);
scanf(“%d”,&a);
printf(“Enter the value of b\n”);
scanf(“%d”,&b);
printf(“Enter the value of c\n”);
scanf(“%d”,&c);
if(a>=b)
if(a>=c)
max=a;
else
max=c;
else
if(b>=c)
max=b;
else
max=c;
printf(“Maximum value is %d”,max);
getch();

}

OUTPUT-

Enter the value of a

5

Enter the value of b

9

Enter the value of c

10

Maximum value is 10

 

 

 

 

Leave a Reply