Calculate 3 numbers with using the formula below:
calculate=(num1*num2)-num3+(num2/num1)
Do a complete C++ Coding.
calculate=(num1*num2)-num3+(num2/num1)
Do a complete C++ Coding.
Answer :
#include<iostream.h>
main()
{
//declare variable
float num1,num2,num3,calculate;
//input1
cout<<"Enter Num1";
cin>>num1;
//input2
cout<<"Enter Num2";
cin>>num2;
//input3
cout<<"Enter Num3";
cin>>num3;
//formula
calculate=(num1*num2)-num3+(num2/num1);
//output
cout<<"Answer is="<<calculate;
return 0;
}
main()
{
//declare variable
float num1,num2,num3,calculate;
//input1
cout<<"Enter Num1";
cin>>num1;
//input2
cout<<"Enter Num2";
cin>>num2;
//input3
cout<<"Enter Num3";
cin>>num3;
//formula
calculate=(num1*num2)-num3+(num2/num1);
//output
cout<<"Answer is="<<calculate;
return 0;
}
Please put the screenshot (printscreen the coding)and output of the programming
ReplyDeleteockey miss..nanti saya edit balik..miss,weekly relection nak kena buat yea.. ?
ReplyDelete