Here are C++ programs to convert pounds to kilograms and vice versa. First program converts pounds to kilograms and second program converts kilogram to pound.
C++ program to convert pounds to kilograms
#include<iostream>
using namespace std;
int main()
{
float kilogram,pound;
cout<<"Enter pound ";
cin>>pound;
kilogram=pound*.454;
cout<<pound<<" pound = "<<kilogram<<" kg";
return 0;
}
using namespace std;
int main()
{
float kilogram,pound;
cout<<"Enter pound ";
cin>>pound;
kilogram=pound*.454;
cout<<pound<<" pound = "<<kilogram<<" kg";
return 0;
}
OUTPUT
C++ program to convert kilogram to pound
No comments:
Post a Comment