Answer to Question #264111 in C++ for Kashce

Question #264111

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-10T14:50:38-0500
#include <iostream>
using namespace std;




int main()
{
	float Kilogram=1;
	while(Kilogram>=0){
		cout<<"Enter Kilogram (Enter -1 to STOP): ";
		cin>>Kilogram;
		if(Kilogram>=0){
			cout<<Kilogram<<" Kg = "<<(Kilogram*1000)<<" grams\n";
			cout<<Kilogram<<" Kg = "<<(Kilogram*2.2)<<" pounds\n\n"; 
		}
		
	}
	return 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