The program is made for deciding which of the two user
defined numbers is greater. if the
numbers entered by the user are same, then it should
display a message accordingly. Develop
program using C language
main.c
#include <stdio.h>
int main()
{
int n1, n2;
printf("Enter number 1: ");
scanf("%d", &n1);
printf("Enter number 2: ");
scanf("%d", &n2);
if(n1 > n2)
printf("%d is grater tham %d", n1, n2);
else if(n2 > n1)
printf("%d is grater tham %d", n2, n1);
else
printf("%d and %d are equal", n1, n2);
return 0;
}
Code Snippet (For Indentation):
Output:
Get Answers For Free
Most questions answered within 1 hours.