/* Smallest number in array. */
We have a array of integers, and we need to find the smallest number in the array.
We should store the first element in smallest variable.
Then we must compare second element with smallest and store smaller element in the smallest variable,
Then we must compare third element with smallest and store smaller element in the smallest variable,
and so on till nth variable.
At the end we with get smallest element.
Time complexity is O(n) and it requires n-1 comparisons.
Skills Learned :
Written with ♥ from Mangesh.
|1||C program to reverse element in array.|
|2||C program to find the smallest number in array.|
|3||C program to find the largest number in array.|
|4||C program for addition of 2D matrix.|
|5||C program to calculate sum of all elements in array.|