Questions:
Write a C++ program that asks for a distance in furlongs and converts it to yards.(One furlong is 220 yards.)
Explanation:
This problem is simple and just demonstration of basic input and output streams. Below mention code is compiled in Visual Studio 2015 and output snap is attached.. If any problem you feel and want explanation feel free to contact.
Code:
Output:
Related Articles:
Write a C++ program that asks for a distance in furlongs and converts it to yards.(One furlong is 220 yards.)
Explanation:
This problem is simple and just demonstration of basic input and output streams. Below mention code is compiled in Visual Studio 2015 and output snap is attached.. If any problem you feel and want explanation feel free to contact.
Code:
/**************************************************|
/*************C++ Programs And
Projects************|
***************************************************/
#include<iostream>
using namespace std;
void main() {
int furlongs, yards = 0;;
cout
<< "Enter distance in
furlongs (US) = ";
cin
>> furlongs;
yards
= furlongs * 220;
cout
<< "Total yards = " << yards << endl;
}
Output:
Related Articles:
0 Questions:
Post a Comment