Why doesnt my program work? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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; }

30th Jul 2017, 11:46 PM
Jeff Zhang
Jeff Zhang - avatar
2 Antworten
+ 11
You wrote: int temp = 0a; Use a numeric value for that data type: int temp = 0;
30th Jul 2017, 11:51 PM
Maz
Maz - avatar
0
well , it need many corrections .
31st Jul 2017, 1:43 AM
Irwin Lopez
Irwin Lopez - avatar