Jun 19, 2019 at 10:46pm Jun 19, 2019 at 10:46pm UTC
I made a simple program here to covert KG to LBS, but how would I for example make the KG count by 2. For example I want the KG chart to go 1, 3, 5, 7, 9, etc.
Thanks!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <iostream>
using namespace std;
int main()
{
const int MIN_NUMBER = 1,
MAX_NUMBER = 10;
int num = MIN_NUMBER;
cout << "Kilograms Pounds\n" ;
while (num <= MAX_NUMBER)
{
cout << num << "\t\t" << (num * 2.2) << endl;
num++;
}
return 0;
}
Last edited on Jun 19, 2019 at 10:59pm Jun 19, 2019 at 10:59pm UTC
Jun 19, 2019 at 11:07pm Jun 19, 2019 at 11:07pm UTC
instead of num++, try num += 2