Q:

C Program to Find the Smallest Among Ten Numbers

0

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

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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 Smallest 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 Smallest Among Ten Numbers  */

#include<stdio.h>

int main()
{
      int num[10],low,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]);
      }

      low=num[0];

      i=0,j=1;

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

      printf("\nThe Smallest Number among 10 Numbers is :: [ %d ]\n",low);

      return 0;
}

Output : :

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

Enter 10 numbers below ::

Enter number 1 :: 1

Enter number 2 :: 2

Enter number 3 :: 3

Enter number 4 :: 4

Enter number 5 :: 5

Enter number 6 :: 6

Enter number 7 :: 7

Enter number 8 :: 8

Enter number 9 :: 9

Enter number 10 :: 0

The Smallest Number among 10 Numbers is :: [ 0 ]

Process returned 0

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

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Number Solved Programs – C Programming

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
C Program to Find the Greatest Among Ten Numbers... >>
<< C Program to Print Natural Numbers in Reverse orde...