+ 1
Why doesnt my program work?
heres my code: #include <iostream> using namespace std; int main() { int input = 0; int output = 0; int temp = 0a; input = 1; while (1==1) { temp = input; if (temp%2==0) { temp = temp/2; } else { ++temp; } if (temp%3==0) { temp = temp/3; } else{ if (temp<3) { output=temp; cout << "Input = " << input << "\nOutput = " << output << endl; input++; output = 0; temp = 0; } } } return 0; }
2 Answers
+ 11
You wrote:
int temp = 0a;
Use a numeric value for that data type:
int temp = 0;
0
well , it need many corrections .