Print greatest number among two in C language

         Print greatest number among two in C language


 #include<stdio.h>

#include<conio.h>

main()

{

int a,b;

clrscr();

printf("enter any number  ");

scanf("%d",&a);

printf("enter one more number  ");

scanf("%d",&b);

if (a>b)

{

printf("%d is greater" ,a);

}

else

printf("%d is greater",b);

getch();

}

Output:-

enter any two number  5   7 



No comments

Powered by Blogger.