Answer to Question #332693 in C++ for Wu Celia

Question #332693

Write a program that displays the following table (note that 1 millimeter is 0.039 inches):

Millimeters Inches

2 0.078

4 0.156

 96 3.744

98 3.822


1
Expert's answer
2022-04-23T09:04:40-0400


//
#include <iostream>
#include <iomanip>
#include <stack>//USE standart Stack
using namespace std;
int main()
{
  //Write a program that displays the following table (note that //1 millimeter is 0.039 inches):
  double inc=1.0;
  //starting loop
  cout<<"||"<<setw(12)<<"millimetr->"<<"||"<<setw(12)<<"inches||\n";
  for(int mm=1;mm<101;mm++)
    {
      inc=mm*0.039;
      cout<<"||"<<setw(12)<<mm<<"||"<<setw(12)<<inc<<endl;
    }
  return 0;
}
//This code tested Lunix online compiler

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS