Thursday, May 19, 2016

C program for finding greatest of two numbers

Program
 #include<stdio.h>
main()
{
int a,b;
printf("enter the values of a and b: \n");
scanf("%d%d",&a,&b);
if(a>b)
{
printf("a is greatest");
}
else
{
printf("b is greatest");
}
}

Output
 enter the values of a and b:
6 4
a is greatest

No comments:

Post a Comment