Please Help

Pages: 12
Again, no code tags. And it looks like you are just taking stabs in the dark with no real understanding of basic C++ code structure. All you are doing now is declaring a global int variable called main, not a function. No opening braces at the end of the declaration either. Even if that was a valid way to declare main, you STILL have the print_even function definition INSIDE it.
I dont think he knows what a function is. He's using someone elses code void print_even

Below is the format you need to learn before you can write anything or as we have seen try to use any code given to you.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Header stuff
#include <iostream>
using namespace std;
// Declare Global variables
int firstNum=1;
int lastNum=20;

// This is a function called print_even
void print_even(int firstNum, int lastNum)
{
// this is a local variables
int currentNum =0;

//  put some code here
}

// your program starts here
int main()
{
// This is a call to print_even passing 2 values
print_even (firstNum,lastNum);

return 0;
}


I recommend doing the hello world tutorial. Google it.
Last edited on
Topic archived. No new replies allowed.
Pages: 12