Write a program to find the greatest of two numbers
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter two numbers\n");
scanf("%d%d",&a,&b);
if(a>b)
printf("%d is greatest",a);
else
printf("%d is greatest",b);
getch();
}
Output:
Enter two numbers
7
8
8 is greatest
No comments: