Computer Science, asked by Mrattitude3, 1 year ago

write a c program input 5 numbers display maximum number of that number using array.


Mrattitude3: not in Cpp answer required in only c.

Answers

Answered by theAmazing
1
void () Dispmax {
int arr [ 5 ];
cout < < " Enter an array of integer \ n ";
for ( int j = 0; j < 5; j + + ) {
cin > > arr [ j ]; }
int Max=arr [ 0 ];
for ( j = 1; j < 5; j + + ) {
if ( arr [ j ]> Max)
Max= arr [ j ];
}
cout < < " Max:"<<Max;
}

Mrattitude3: but I want this programme in c not in Cpp.
theAmazing: It should work on both the platforms
Similar questions