M
m2k_stp
#include "callFirst.hpp" //contain iostream, namespace, and basic
operations
int main()
{
int x[10];
int Ops;
for(int i = 0; i < 10; i++){
x = i * 2;
}
int k = 0;
while( k < 10){
int j = 0;
cout << x[j];
cout << " ";
j++;
k++;
}
int dummy;
cin >> dummy;
return 0;
}
why I get output as 0 0 0 0 0 0 0 ...
suppose it should be 0 2 4 6 ...
how do I fix this?
operations
int main()
{
int x[10];
int Ops;
for(int i = 0; i < 10; i++){
x = i * 2;
}
int k = 0;
while( k < 10){
int j = 0;
cout << x[j];
cout << " ";
j++;
k++;
}
int dummy;
cin >> dummy;
return 0;
}
why I get output as 0 0 0 0 0 0 0 ...
suppose it should be 0 2 4 6 ...
how do I fix this?