Question: Help me with C + + code: Complete the code to output 6 0 seconds = 1 minute. On the next line, output the
Help me with C code:
Complete the code to output seconds minute". On the next line, output the value of lengthSecs to two digits after the decimal point, followed by seconds and then the value of lengthMins to four digits after the decimal point, and lastly minutes". End with a newline.
Ex: If the input is then the output is:
seconds minute
seconds minutes
Note: setprecisionX can be used in an output statement to print a double to X digits after the decimal point.he right C code:
#include
#include
using namespace std;
int main
double lengthSecs;
double lengthMins;
cin lengthSecs;
lengthMins lengthSecs ;
cout seconds minute" endl;
std::cout std::setprecision lengthMins;
cout lengthSecs seconds lengthMins minutes";
cout
;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
