Jump to content

Find the greatest number from 3 integers using C

From IdeaWazaWiki

<source lang="c">

  1. include<stdio.h>

/* main: display largest of three unequal values */ int main(void) {

   int a, b, c;
   printf("enter three unequal integers: ");
   scanf("%d%d%d", &a, &b, &c);
   printf("%d", (a > b ? a : b) > c ? (a > b ? a : b) : c);
   /* indicate success */
   return 0;

} </source>