Posts

Showing posts with the label array of numbers

C programming Minimum and Maximum of Numbers

It has two C programming code to find minimum value and maximum value of numbers, they are Minimum of Numbers - The input of the program is N numbers and the output is minimum of given inputs Maximum of Numbers - The input of the program is N numbers and the output is maximum of given inputs Minimum of array of numbers - Algorithm set min=INT_MAX Read N integers For i=1 : N IF integers[i] Maximum of array of numbers - Algorithm set max=0 Read N integers For i=1 : N IF integers[i] > max then max =integers[i] End IF End For print max Minimum of Numbers - C programming code The C program reads N integers from user while the program is running, and prints the result minimum value of given integers # include <stdio.h> # include < string...

C program Sum and Average of N numbers

It has two C program to do sum and average of N numbers. Sum of N numbers - N integers are given to it as input and return sum of input integers as result Average of N numbers - N integers are given to it as input and return average of inputs integers as result Sum of N numbers - algorithm The input N integers read from user add the N integers store result into a variable sum. and then prints sum value after end of loop. set sum=0 Read N integers For i=1 to N sum = sum + integers[i] End For print sum Average of N numbers - algorithm The input N integers read from user add the N integers store result into a variable sum. after end of loop, divide sum value by N and store results into a variable average, then prints average value . set su...