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.
#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);
}
Comments
Leave a comment