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
//
#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
Comments
Leave a comment