Computer Science, asked by Divyanshb01, 1 year ago

write a c program to find maximum number between two number's?

Answers

Answered by Róunak
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 !!

Róunak: is it ok !
Divyanshb01: yes brother
Róunak: hm
Divyanshb01: thank you so much ❤️
Róunak: anytimr
Answered by sougatap57
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