Hello guys help me solve the problem, Write a code using a function to determine the minimum value of six numbers in C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hello guys help me solve the problem, Write a code using a function to determine the minimum value of six numbers in C++

Int main(int,int,int,int,int,int); int main () { cout<<"Enter six integers:"; int a,b,c,d,e,f,g; cin>>a>>b>>c>>d>>e>>f>>g; cout<<"Their minimum is"<<min(a,b,c,d,e,f,g)<<endl; return 0; } int min(int n1,int n2,int min3,int min4,int min5,int min6) { int mim=n1; if(n2<min) min= n2; if(n3<min) min= n3; if(n4<min) min= n4; if(n5<min) min= n5; if(n6<min) min= n6; return min; }

5th Dec 2019, 10:00 PM
Dmitry Yashin
Dmitry Yashin - avatar
1 Answer
+ 2
You can also sort the values in ascending order and get min, max Value.
5th Dec 2019, 10:03 PM
A͢J
A͢J - avatar