bsc

Comprehensive codebase and coursework for the 4-year B.Sc. Computer Science Honours degree (WBSU)

git clone https://github.com/notamitgamer/bsc.git
· rebuilt hourlyOpen on GitHub
root / semester_1 / letusc / luc025.c

luc025.c (523B)


      1 /* Write a program to find the greates of the three numbers entered
      2 through the keyboard. Use conditional operators. */
      3 /* Let Us C, Chap- 4, Page - 72, Qn No.: E(c) */
      4 
      5 #include <stdio.h>
      6 int main()
      7 {
      8     double num1, num2, num3, max;
      9     printf("Enter three number : ");
     10     scanf("%lf %lf %lf", &num1, &num2, &num3);
     11     printf("\nGreatest of the three number '%g', '%g' and '%g' is : '%g'", num1, num2, num3, 
     12         (num1 > num2 && num1 > num3) ? num1 : ((num2 > num1 && num2 > num3) ? num2 : num3));
     13     return 0;
     14 }