Page 1 of 1

How to use c++ to make a pound to kilo converter

Posted: Wed Mar 06, 2013 11:34 pm
by benji_19994
How to use c++ to make a pound to kilo converter
Code: Select all

#inlcude <iostream>
//include I/O stream

int main()
{
int NumInPounds;
//Create an int

std::cout << "Please Enter The number in pounds" << std::endl
//ask the user to inset number

std::cin >> NumInPounds;
//Get the number the user entered and store in NumInPounds
float nResult;
//Creat a float for the result
nResult = NumInPounds / 2.2;
//devide by 2.2 to get the answere
std::cout << "The result is ";
std::cout << NumInPounds;
//Print the answer out =D
return 0;
}
[code/]