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; }
1 Antwort
+ 2
You can also sort the values in ascending order and get min, max Value.