Computer Science, asked by rutujafasate28, 1 year ago

write a c program to find greatest of two number using if with example​

Answers

Answered by sushiladevi4418
1

Answer:

C program to find greatest of two number

Explanation:

/* C Program to Find Largest of Two numbers */  

#include<stdio.h>  

#include<conio.h>

int main()

{  

   int x, y;  

   printf("Please Enter number x:\n");  

   scanf("%d", &x);

   printf("Please Enter number y:\n");  

    scanf("%d", &y);

   if(x > y)  

   {

       printf("x is larger than y");          

   }  

   else if (y > x)

   {  

       printf("y is larger than x");  

   }  

   else  

   {

printf("Both are Equal");

   }

   getch();

}

Output:

Please Enter number x:2

Please Enter number y:3

y is larger than x

Similar questions