Write a program to find greatest of three number .

Write a program to find greatest of three number .

 

#include <stdio.h>

#include  <conio.h>

void main()

{

int  a,b,c;

clrscr();

printf (“Enter three number”);

scanf (“%d %d %d”,&a,&b,&c);

if (a>b)

{

if (a>c)

{

printf(“%d is greatest”,a);

}

else

{

printf(“%d is greatest”,b);

}

}

elseif(b>c)

{

printf(“%d is greatest ”, b);

}

else

{

printf(“%d is greatest”,c);

}

getch();

}

 

Output:

Enter three number:3 5 8

8 is greatest


Comments