473,396 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Program is running but it won't stop compiling. What am i doing wrong ?

#include <iostream>

using namespace std;

int main() {

int remainder = 0;
for (x = 0; x < 99, x++) {

cout << "value of x:" << endl;

remainder = rand() % 2;
switch(remainder) {
case = 0:
cout << "even" << endl;
break;

case 1:
cout << "odd" << endl;
break;

system("pause");
return 0;
}
}
}
Nov 20 '14 #1
2 1202
weaknessforcats
9,208 Expert Mod 8TB
Your program is not running. It doesn't even compile.

This code:

Expand|Select|Wrap|Line Numbers
  1. for (x = 0; x < 99, x++) {
  2. etc...
does not create the variable x. You need to create the variable before you use it. Also, that comma after 99 needs to be a semi-colon.

This code:

Expand|Select|Wrap|Line Numbers
  1. case = 0:
  2.  
as an = operator that needs to be removed.

Make these fixes and try it again.

Post again if you are still stuck.
Nov 20 '14 #2
I guess, OP mean, compiler is running fine but he is getting compilation errors.

Expand|Select|Wrap|Line Numbers
  1. for(int x=0;x <99; x++)
  2. ..
  3.  
Also system("pause") may not work, what are you trying to program for?
Nov 20 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jefferson Cowart | last post by:
I've got a C# program that seems to be adept at preventing the system from rebooting. If it is running when you tell the system to reboot it closes and then somehow stops the reboot from happening....
3
by: J | last post by:
Hi, I've a problem with a page I've developed, and I can't see where I'm going wrong. I've created a dataset called "Recipients", and in this dataset, I've created two tables, one called...
2
by: Phil Certain | last post by:
Hi, Relative newbie to .Net but experienced with classic ASP. I am trying to create a simple business object to contain commonly used functions. This is what I have done: 1 - Created a simple...
5
by: ken | last post by:
Hi, I have two questions the first is: in the example below how can I call an event from within a statement, such as replace Stop1 with cmdStop1 which is a button on my form? My second question...
14
by: William LaMartin | last post by:
If I have a Windows application with no form--only a module that starts with sub main and which has a system timer, in the elapsed event of which I want to run some code, how can I keep this...
1
by: Yobbo | last post by:
Hi All I use the following script to stop users typing in anything but standard chars (eg letters, numbers, etc) into a input textbox: <!-- // 8 = backspace // 9 = tab // 46 = del // 190 =...
0
by: John Dann | last post by:
I have a program that needs to access a prewritten external data file that is supplied with the program. I want to place this data file in...
7
by: Sunil Korah | last post by:
Hi, I haven't used access reports much. I have a problem in getting the total of a group. I have 3 fields, ProgName (Program name), Pname (Participant's name) and PCategory (Participant...
2
by: alnoir | last post by:
I've looked around online and have even had a friend help me, however, for some reason I can't compare two strings. I'm doing this at the end of the code (within the two foreach loops), above...
8
by: watkinsdev | last post by:
Hi, I have created a mesh class in visual studio 6.0 c++. I can create a device, render objects and can edit the objects by for instancnce selecting a cluster of vertices and processing the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.