0
why this wont work
MÄhĆĂąÄ HĂźÄÄÄĆ: #include <iostream> using namespace std; int main() { int b; int a[10]; for(int i=0;i<5;i++) { cout«"Inter number: "; cin»a[i]; a[i]=b; } for(int i=0;i<5;i++) { cout«a[i]«endl; } return 0; }
2 Answers
+ 10
Where are you trying to run this code? Code Playground? Input and loops don't work well together on Code Playground, but your code should work fine of desktop compilers.
Also, remember to use << and >> instead of « and ».
+ 1
a[i] = b; Is invalid, you did not initialize the value of b... unless you are doing that intentionally?