473,385 Members | 1,347 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,385 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 1201
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.