Help me

Help I am getting error and I don't know where. I am new to C++

1
2
3
4
5
6
7
8
9
10
11
12
13
14
  #include <iostream>
using namespace std;
{
  int sample[8];

    int i;
    int k
    for (k=0; k < 8; k++);
    if (k % 2 ==0)
    sample[k] = k;
    else
            sample[k] = k + 100;
            return 0;
}
remove semi-colon from end of line 8.

and use indenting and braces to make your for.. else more readable.
Last edited on
move the semicolon from the end of line 8 to the end of line 7
Still same error and by mistae I reported mutexe... I am so sorry

#include <iostream>
using namespace std;
{
int sample[8];

int i;
int k;
for (k=0; k < 8; k++)
if (k % 2 ==0)
sample[k] = k;
else
sample[k] = k + 100;
return 0;
}
please listen. indent your code.

your code body needs to be inside a main function...


Last edited on
where is the head of function?
wtf have i been reported?
where is the head of function?
what do you mean by that?
it worked anyway...Thank you mutexe
did you report me?
Yes by mistake.. I am so sorry.. I thought it was reply button....
Mutexe,
I am new to this forum and I am new to c++ so forgive me I need a lot of help in c++.
No worries dude :)
Topic archived. No new replies allowed.