Problems with functions for c++

We have a problem that asks us to write a void function that uses two nested for loops and the modulus operator to print out prime n integers. The function prototype is primeGen(int n). The only problem I am having is returning the value of i back to the main function can someone help me please?
http://codepad.org/KxutY78T
If there is neither a paramter that can hold the result nor a return type you can only store the result in a global variable.
You don't need to return the value. In this problem you are to just print out the numbers. Which you can easily achieve by using the 'printf' or 'cout' command inside the nested loop. If you need further help then PM me.
Topic archived. No new replies allowed.