Q: Write a C Program to Find Smallest Number in Array
The Basic Logic of Smallest Number in Array Program
- First of all the user will input any 5 numbers in array.
- The program assumes that the first number is minimum number
- min = numArray;
- This C program uses a for loop to get each number in the given array and compare it with current minimum number. If the current item of array is less than current minimum number, then assign current array item to min
- if( numArray[i] < min)
- min = numArray[i];
- After termination of loop the minimum number will be in min variable.
- Display the value of min variable
The Source Code for c program to show minimum number in array is as follows: