Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Find the max and min number in array
#include <iostream> using namespace std; int main() { int num_of_students; int total_score = 0; int score[] { 8,4,1,2,9,75,8,3,4,5 }; int max=0 ; int min =0; num_of_students = sizeof(score)/sizeof(score[0]); for(int i =0;i<num_of_students;i++) { if(score[i] > max) max = score[i]; } min = max; for(int i =0;i<num_of_students;i++) { if(score[i] < min) min = score[i]; } cout<<"Max: "<<max<<endl; cout<<"Min: "<<min<<endl; }
run
|
edit
|
history
|
help
0
Roger Cheng
template
Org
e-olymp.com---problem1590---Birthday 2
CharSearch
Rzutka gra 2
gal2
pointer array of functions
Area of a triangle using templete
always_late