Programming in "C‟ | Write a „C‟ program to accept 10 numbers in an array and display the smallest number from them.

 #include<stdio.h>

main()

{

 int a[10];

 int i,min=0;

 clrscr();

 printf("Enter 10 integers");

 for(i=0;i<10;i++)

 {

   scanf("%d",&a[i]);

  }

    min=a[0];

     for(i=0;i<10;i++)

  {

     if(min>a[i])

     min=a[i];

    }

  printf("Minimum number: %d",min);

  getch();

Post a Comment

0 Comments