C Program To Find Greatest In 4 Numbers

C Program To Find Greatest In 4 Numbers

#include<stdio.h>

int main()
{
   int a, b, c,d;

   printf("Enter value of a, b ,c & d :\n");
   scanf("%d %d %d", &a, &b, &c);  //input from user

   if ((a > b) && (a > c)&& (a > d))
      printf("a is greatest\n");

   if ((b > c) && (b > a) && (b > d))
      printf("b is greatest\n");

   if ((c > a) && (c > b)&& (c > d))
      printf("c is greatest\n");
   
   if ((d > a) && (d > b)&& (d > c))
      printf("d is greatest\n");

}
Copyright © C Program | Java | OpenGL Programming | Hadoop at Computaholics