Computer Science, asked by shruti579, 1 year ago

write a program to accept 3 numbers and print the greatest number​

Answers

Answered by suneelgoli
1

Answer:

In C language:

#include <stdio.h>

void main()

{

   int a, b, c;

   printf("Enter the values of a, b and c\n");

   scanf("%d %d %d", &a, &b, &c);

   printf("a = %d\b = %d\tc = %d\n", a, b, c);

   if (a > b)

   {

       if (a > b)

       {

           printf("%a is the greatest among three \n",a);

       }

       else

       {

           printf("%d is the greatest among three \n",c);

       }

   }

   else if (b > c)

       printf("%d is the greatest among three \n",b);

   else

      printf("%d is the greatest among three \n",c);

}

Similar questions