MAX OF TWO NUMBERS
Code :
#include<stdio.h>
int main()
{
int num1, num2;
printf("======================================\n");
printf("\tMAX OF TWO INTEGERS\n");
printf("======================================\n");
printf("Enter two integers: ");
scanf("%d %d", &num1, &num2);
printf("\n");
if(num1 > num2)
{
printf("%d is greater than %d\n", num1, num2);
}
else if(num2 > num1)
{
printf("%d is greater than %d\n", num2, num1);
}
else if(num1 == num2)
{
printf("Both are equal %d and %d\n", num1, num2);
}
printf("--------------------------------------\n");
return 0;
}
Come again Learn again !
« iCodeBuzz »
No comments:
Post a Comment