Tag Archives: maximum

CPP03 – Write a CPP program to find the maximum marks, average-marks and minimum marks obtained by a study in five papers given

Write a CPP program to find the maximum marks, average-marks and minimum marks obtained by a study in five papers as given below: Paper 1            Paper 2            Paper 3            Paper 4            Paper 5 Marks              50                    70                    65                    80                    56 CODE:- #include<iostream.h> #include<conio.h> void main() { int… Read More »

C029 A C program with a function that returns the minimum and the maximum value in an array of integers

void minmax(int array[],int length,int *min,int *max); //prototype Let’s identify variables needed for this program. In this program, we need several variables to store array of decimal numbers and count the length of array and store minimum and maximum of the array. First variable will be the one which will save the list of integers in… Read More »

C012 A C program that uses macros, MIN & MAX, to find and return, respectively the minimum & maximum of two values

Macro are the small code which is substituted wherever the macro is refered. macros can be used in two ways : First way as a replacement to the code which is long in length or repeated all the time.  e.g. #define CUBE(X) (X*X*X) Second way as a small function in which we can pass arguments… Read More »