Random

I am making this random program for fun just trying some basic stuff but i would like to add that someone could input something say like the number 3 and only 3 varibles will pop or like if they put in for it will make 4 so then later you could put input 3 different numbers for each of the varibles
Hey Mate, you could try a for loop ie:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
using namespace std;

int main()
{
int numSel = 0;
cout << "# of Results:";
cin  >> numSel;

for (int i = 0; i<=numSel; i++)
  {
    //I will let you put the code in ;P  
  }

  return 0;
}


Pretty much that code asks for the user to input a number of results they would like to display, then it starts a for loop that checks if the loop control variable (i) is less than or equal to numSel (the variable holding the number of results the user wants)

The loop will stop when i reaches the value of numSel. Ill leave the code to put inside the loop upto you =)
Last edited on
Yeahhh,,,, i think that may be a little to complicated for me but I have another question...

When I am done the solution and all that how would I deploy it had an application so i could actually use it on my computer?
Hi again, looks like you might need to read some tutorials on C++ as a for loop is one of the fundamentalas of the language.

Now, if I understand correctly you want to build your application. If you are using an IDE then there should be a button called build/compile. If you click this then your program should compile.
Hope this helps.
Yes I was actually looking at the for loop on the tutorial on the website..
But what i meant was if there was something that i could put on like my desktop so if i click on it, the program will pop up
If you look in your compilers projects directory, if you look really hard (usually its in a file called bin) you should find the program executable. You can move that to your desktop and run it if that is what you mean.
Last edited on
Topic archived. No new replies allowed.