C program to find the largest of n integer numbers using Conditional Operator

C Program to find the largest (biggest or greatest or maximum) among n integer numbers using Conditional (ternary) Operator

We can find the largest (biggest or greatest or maximum) of n integer numbers using Conditional (ternary) Operator. Now, We can write C Program to find the largest (biggest or greatest or maximum) among n integer numbers using Conditional (ternary) Operator. For example:  if we input as 34, -67, 28, 12, 30, -43, 86, 24, 33, 75 then  the largest (biggest or greatest or maximum) among n integer numbers is 86. The below given C program will find the largest (biggest or greatest or maximum) of n integer numbers using Conditional (ternary) Operator.  Kindly check out the program to find largest (biggest or greatest or maximum) of n integer numbers.

Program to find largest of n integer numbers using Conditional (ternary) Operator. 


  #include<stdio.h>
  int main()
       {
        int a, e, f, n;
        clrscr();
        printf(" How many integer numbers : ") ;
        scanf("%d", &n);
        printf(" Enter the %d integer numbers : ", n) ;
        scanf("%d", &f) ;
        for(a=1;a<=n-1;++a){
        scanf("%d", &e) ;
        f = (e > f? e : f);
        }
        printf("\n\n The Largest among  %d integer numbers using Conditional ternary Operator is : %d", n, f) ;
        getch();
        return 0;
        }

  


Sample Output:

How many integer numbers : 10

Enter the 10 integer numbers :  45  54  21  -89  49  11  90  22  -58  72


The Largest among 10 integer numbers using Conditional ternary Operator is :  90


Other Related C Programs :


* C Program to find whether the given number is Odd or Even

* C Program to find the Sum of Odd Digits

* C Program to find the Sum of Even Digits

* C Program to find the Sum of Even and Odd Digits,

* C Program to Display Odd digits

* C Program to Display even digits

* C Program to Display Odd Numbers,

* C Program to Display Even Numbers,

* C Program to Check whether the given number is Armstrong number

* C Program to display the Armstrong numbers in Range

* C Program to display the Armstrong numbers between 1 and 1000

* C Program to check perfect number, perfect numbers in range

* C Program to Check Prime number, Prime numbers between 1 and 100

* C Program to display the Prime numbers in a Range

* C Program to display the Sum of Prime numbers

* C Program to Check Strong number

* C Program to display the Strong number in Range

* C Program to Check whether the given number is polindrome number or not

* C Program to Check polindrome number using for loop

* C Program to Check polindrome number using Recursion

* C Program to  check whether the given string is polindrome or not

* C Program to find the Roots of Quadratic equation

* C Program to display Fibonacci Series

* C Program to display the Fibonacci Series using an array

* C Program to display the Fibonacci Series using while loop

* C Program to find the Sum of Fibonacci Series, Factorial of Number

* C Program to find the Factorial without using Recursion

* C Program to find the Factorial using Pointers

* C Program to find the Factorial using Function

Bookmark and Share