75 : C Program to find min of 10 numbers using array

Check out the complete list of c-programs : C Program List    





Program to find min of 10 number inputted by user and stored in an integer array.

Logic :
//Reading 10 numbers from console and saving them in array
  for(i = 0; i<10;i++) {
     
      printf("Enter no. %d   : \n",i+1);
      scanf("%d",&arr[i]);
      
    
     
 }
 
 //Consider arr[0] as min.
  min = arr[0];
 
 
// Finding the min number

 
 for(i = 0; i<10;i++) {
     
       if(arr[i]<=min) {
           
           min = arr[i];
       }










/*
 * 1000+ C programs + tutorials
 *
 * 
 * 75_c_program_to_find_min_of_10_numbers_inputted_using_array.c
 *  
 *  
 *
 *  Created on: Oct 25, 2014
 *  Author: Code2care.org
 */

#include 
//#include 

void main() {


//clrscr();

int arr[10];
int i;
int min;
 

printf("\n Enter 10 numbers : \n\n");
 
 for(i = 0; i<10;i++) {
     
      printf("Enter no. %d   : \n",i+1);
      scanf("%d",&arr[i]);
      
    
     
 }
 
 min = arr[0];
 
 for(i = 0; i<10;i++) {
     
       if(arr[i]<=min) {
           
           min = arr[i];
       }

}
 printf("Min number : %d",min);
 
//getch();  
   
 }










The best way to learn C programming is to practice more and more of programs . Code2care C Programming tutorials provide 1000+ programs in C that you can study and become an expert in the language. Programs are divided into categories depending upon type and complexity.

BSc. IT, BSc. Computer Science, BSc. IT, MSc. IT, MSc. Computer Science, MCA, BTech IT & BTech Engineers may find these programs very useful.