write a program that reads values representing the weight in kilograms Assignmen
ID: 3759094 • Letter: W
Question
write a program that reads values representing the weight in kilograms Assignments 3 1 Write a program that reads values representing the weigh kilograms, grams, and milligr ams and then prints the equivalent weight in milligrams for example, 1 kilogram,50 anns " and 42 miligrams is equivalent to 10,50,042 milligrams ) 2. Write a program that prompts for and reads the 2 Write a prog am that prompts for and reads the circumterence of a cardle as a floating ponVe (doub then prints the radius of the ole valise (doubExplanation / Answer
#include <iostream>
using namespace std;
int main() {
int total=0;
int temp;
cout<<"Enter kg part of weight: ";
cin>>temp;
total += temp*1000000;
cout<<"Enter gm part of weight: ";
cin>>temp;
total += temp*1000;
cout<<"Enter mg part of weight: ";
cin>>temp;
total += temp;
cout<<" Weight is: "<<total<<" milligrams";
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.