93.2k views
2 votes
Write a program in which you input three numbers they canhave decimals so float values and the program gives you the minvalue out of the three. Please need asap thank you

User SHH
by
4.9k points

1 Answer

4 votes

Answer:

Following is the c++ code:-

#include <bits/stdc++.h>

using namespace std;

int main() {

float a,b,c;//declaring three float variables..

cout<<"enter values"<<endl;

cin>>a>>b>>c;//taking input..

float mi=min(a,b);//finding minimum in a and b..

mi=min(mi,c);// finding minimum from mi and c.

cout<<mi<<endl;//printing the answer.

return 0;

}

Step-by-step explanation:

I have taken three float variables to hold the values.

then I am finding the minimum in a and b and storing it in mi.

Then finding minimum from mi and c so we will get our final minimum number.

User Fabian Knorr
by
5.5k points