write a c program to find maximum number between two number's?
Answers
Answered by
0
Hey mate...
=========
C program for your above code :-
_____________________
#include <stdio.h>
int main()
{
int num1, num2;
/* Input two numbers from user */
printf("Enter two numbers: ");
scanf("%d%d", &num1, &num2);
/* If num1 is maximum */
if(num1 > num2)
{ printf("%d is maximum", num1); }
/* If num2 is maximum */
if(num2 > num1)
{
printf("%d is maximum", num2);
}
/* Additional condition check for equality */
if(num1 == num2)
{
printf("Both are equal");
} return 0;
}
Hope it helps !!
=========
C program for your above code :-
_____________________
#include <stdio.h>
int main()
{
int num1, num2;
/* Input two numbers from user */
printf("Enter two numbers: ");
scanf("%d%d", &num1, &num2);
/* If num1 is maximum */
if(num1 > num2)
{ printf("%d is maximum", num1); }
/* If num2 is maximum */
if(num2 > num1)
{
printf("%d is maximum", num2);
}
/* Additional condition check for equality */
if(num1 == num2)
{
printf("Both are equal");
} return 0;
}
Hope it helps !!
Róunak:
is it ok !
Answered by
0
Answer:
#include <stdio.h>
int main()
{
int a,b;
printf("enter the two numbers");
scanf("%d%d",&a,&b);
if(a>b)
{
printf("greater=%d",a);
}
else if(b>a)
{
printf("greater=%d",b);
}
else
{
printf("smaller");
}
return 0;
}
Output
enter the two numbers 5 6
greater=6
Similar questions