Source code to find the greater number among two numbers using if-else statements in C programming language.
#inlcude<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf(“Enter the two numbers:”);
scanf(“%d%d”,&a,&b);
if(a>b)
{
printf(“First number is greater than second number”);
}
else
{
printf(“Second number is greater than first number”);
}
getch();
}
Output:-
Also read:- Sum of two numbers.


0 Comments