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
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;
}
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;
}
Similar questions