Find the greatest among three numbers using C.


#include <stdio.h>

#incclude<conio.h>

int main( )

{

   int x, y;

   printf("Enter the value of x\t");

   scanf("%d", &x);

   printf("Enter the value of y\t");

   scanf("%d",&y);

   if (x != y)

   {

printf("x is not equal to y\n");

if (xx >y )

{

        printf("x is greater than y\n");

}

else

{

printf("y is greater than x\n");

}

   }

   else

   {

printf("x is equal to y\n");

   }

   return 0;

}

Output:


















output:











No comments:

Post a Comment

theengineerschoice01@gmail.com