Answer to Question #264895 in C++ for Rille

Question #264895

19. Make a program that will input Kilogram, convert it into grams and pounds. Display the equivalent Gram/s and Pounds (1 Kg=1000 grams and 1 Kg = 2.2 pounds. Your program will be terminated if you input zero in the kilogram.

1
Expert's answer
2021-11-14T09:20:58-0500
#include<iostream>
using namespace std;
int main(){
	int x;
	do{
		cout<<"Enter weight in KG\n";
		cin>>x;
		cout<<"Weight in grams is: "<<x * 1000<<endl;
		cout<<"Weight in pounds is: "<<x * 2.2<<endl;
	}while(x !=0);
}

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