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

All tutorials created in C++ to be posted in here.
1 post Page 1 of 1
Contributors
User avatar
benji_19994
VIP - Donator
VIP - Donator
Posts: 156
Joined: Mon Apr 16, 2012 3:13 pm

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/]
1 post Page 1 of 1
Return to “C++ Tutorials”