0
Help me fix this code i cant run it
#include<iostream> using namespace std; int main() {switch (z) { case 1: z = (z + 10) * 25; cout << x <<; break; case 2: z = z - 10; cout << x + 30 <<; break; case 3: z = z - 10; cout << z <<; break; default: cout << z * z <<; break; } return 0; }
3 Réponses
+ 2
cout << something;
OR
cout << something << endl;
And you have to declare your variables first before using it to your program.
int x;
int z;
+ 2
And also the variable "x".
Here, try to run this code, this is working because the x and z are declared beforehand and I added endl to each "cout". Excuse my indentions for now. If you want explanations, feel free to ask. Thanks!
https://code.sololearn.com/cA5A24A4a2a1
+ 1
I cant run it even if i declare variable z