C Program to find largest of n numbers without using Array

C Program to find the largest of n numbers without using Array

We can write a C Program to find largest among n numbers without using Array.   For example:  if we  given 7 input  numbers as  65, 76, 54, -98, 35, 23, 93, then  the largest of 7 numbers without using Array is 93. The below given C program will find the largest (biggest, greatest or highest or maximum) of n numbers.  Kindly check out the program to find the largest (biggest, greatest or highest or maximum) of n numbers.

largest (biggest or greatest or highest or maximumof n numbers Program


    #include<stdio.h>
    int main(){
                   int n, s1, s2, z;
                   printf(" How many Integer numbers : ");
                   scanf("%d", &n);
                   z=n;
                   if(n>0){
                   printf("\n Enter the First number : ");
                   scanf("%d", &s1);
                   n--;
                   if(n>0){
                   for(;n>=1; n--){
                   printf("\n Enter the next number : ");
                   scanf("%d", &s2);
                   if(s1<s2)
                   s1=s2;
                   }
                   }
                   }
    printf("\n The Largest of %d numbers is %d", z, s1);
    return(0);
    }

  


Sample Output:

                       How many Integer numbers : 7
                       Enter the First number : 47
                       Enter the next number : 43
                       Enter the next number : 87
                       Enter the next number : 23
                       Enter the next number : 7
                       Enter the next number : -72
                       Enter the next number : 57

                       The Largest of 7 numbers is 87

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