C Program to Find the Greatest Among Ten Numbers

By | November 5, 2016

Greatest Among Ten Numbers


Write a C Program to Find the Greatest Among Ten Numbers. Here’s simple C Program to Find the Greatest Among Ten Numbers in C Programming Language.


Numbers in C


Normally, when we work with Numbers, we use primitive data types such as int, short, long, float and double, etc. The number data types, their possible values and number ranges have been explained while discussing C Data Types.


Here is source code of the C Program to Find the Greatest Among Ten Numbers. The C program is successfully compiled and run(on Codeblocks) on a Windows system. The program output is also shown in below.


SOURCE CODE : :


/*  C Program to Find the Greatest Among Ten Numbers  */

#include<stdio.h>

int main()
{
  int num[10],grt,i=0,j=1;

  printf("\nEnter 10 numbers below :: \n");
  for(i=0;i<10;i++,j++)
  {
      printf("\nEnter number %d :: ",j);
      scanf("%d",&num[i]);
  }

  grt=num[0];
  i=0,j=1;

  for(;i<9;i++)
  {
    if(grt<num[i+1])
    {
        grt=num[i+1];
    }
  }

  printf("\nThe largest number among 10 Numbers is :: [ %d ]\n",grt);

  return 0;
}

Output : :


/*  C Program to Find the Greatest Among Ten Numbers  */

Enter 10 numbers below ::

Enter number 1 :: 4

Enter number 2 :: 1

Enter number 3 :: 5

Enter number 4 :: 7

Enter number 5 :: 9

Enter number 6 :: 8

Enter number 7 :: 3

Enter number 8 :: 2

Enter number 9 :: 4

Enter number 10 :: 5

The largest number among 10 Numbers is :: [ 9 ]

Process returned 0

Above is the source code for C Program to Find the Greatest Among Ten Numbers which is successfully compiled and run on Windows System.The Output of the program is shown above .

If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.


Thanks for reading the post….

Leave a Reply