#Why isnt this working?

5 messages · Page 1 of 1 (latest)

spark pagoda
#

#include <iostream>
#include <cstdlib>
using namespace std;

int main()
{
char maxLines;
cout<< "How many lines will you play";
cin >> maxLines;

switch (maxLines)
{
case 1:
cout << 1 + rand() % 100;
break;
case 2:
cout << 1 + rand() % 100;
cout << 1 + rand() % 100;
break;
case 3:
cout << 1 + rand() % 100;
cout << 1 + rand() % 100;
cout << 1 + rand() % 100;
break;
case 4:
cout << 1 + rand() % 100;
cout << 1 + rand() % 100;
cout << 1 + rand() % 100;
cout << 1 + rand() % 100;
break;
case 5:
cout << 1 + rand() % 100;
cout << 1 + rand() % 100;
cout << 1 + rand() % 100;
cout << 1 + rand() % 100;
cout << 1 + rand() % 100;
break;
}
}

junior perchBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.

spark pagoda
#

When i enter the number 1 through 5 no random number apears

#

nvm i figured it out

#

!solved