c programming code
c programming code
PRESENTED BY:
INTRODUCTION:
Create a program that will find the smallest number among n numbers given by
the user.
PROBLEM STATEMENT:
The user will input some numbers. The program will find the smallest number
among those numbers and output it
ALGORITHM :
STEP 1: First some initial messages are printed which send a message
to the user that the program will find the smallest number.
STEP 2: The user is asked to input n numbers, which will tell how
many numbers to work on. n integers are taken from the user and
stored in an array.
STEP 3: A loop is used, which allows the user to input each number.
Each time the loop is executed, the user inputs a number, which is
stored in the array.
STEP 4: Assume that the first element is the smallest. .Then the rest
of the numbers are compared using a for loop. If any number is
smaller than smallest, then smallest is updated.