Declare the variables R1, Rf, V1 and Vout as data types of your choice.
Allow the user to enter the value for V1.
Calculate the value of Vout
(what happens if Vout exceeds the supply voltage?)
Display all of the voltage values to the screen using appropriate formatting
int main()
{
//declaring variables:
float r1, rf, v1, vout;
r1=10000
rf=10000
}
printf("allow the user to enter the value for v1");
scanf("%f",&v1);
vout= (rf/r1)*v1;
First, I have declare the four variables as float and initialize them. Then I allow the user to enter the value of v1 of thier choice. Now I am trying to run the programme and it won't and gives me warning of unused variables (v1, vf). I am kinda stuck here and don't know what to do next. Any sort of help would be appreciated. I have attached the whole question please do have a look.
Question
Vick472
The program is to;
(what happens if Vout exceeds the supply voltage?)
First, I have declare the four variables as float and initialize them. Then I allow the user to enter the value of v1 of thier choice. Now I am trying to run the programme and it won't and gives me warning of unused variables (v1, vf). I am kinda stuck here and don't know what to do next. Any sort of help would be appreciated. I have attached the whole question please do have a look.
Link to comment
Share on other sites
15 answers to this question
Recommended Posts