Wrox Programmer Forums
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 26th, 2003, 06:51 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default For Loop

Hi Guys,

I am starting to use c# and am going through the different types of loops. I want to run a for loop which displays some numbers. I use the following code: -

using System;

class MainClass
{
    public static void Main(string[] args)
    {
        //Console.WriteLine("Hello World!");
        for (int i = 1;i < 100;i++}
            {
                Console.WriteLine("The Number is: " + i);
            }
    }
}

and I get the following errors: -

Invalid Token '{' in class, struct or interfae member declaration(CS1519)

I dont understand what I have done wrong??

Thanks

Adz

Adz - Portsmouth Massive
__________________
Adz - Learning The J2EE Ways.
 
Old December 26th, 2003, 07:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
for (int i = 1;i < 100;i++}
...should be an ordinary parenthesis!

Jacob.
 
Old December 26th, 2003, 07:38 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default

Thanks

Adz - The World is not enough





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with for-each loop athanatos XSLT 0 April 10th, 2006 07:20 PM
Do Until loop with IF crmpicco Classic ASP Databases 2 June 15th, 2005 05:35 PM
For....Loop kliu9 Excel VBA 5 February 10th, 2005 06:43 AM
Do Loop junemo Beginning PHP 8 July 28th, 2004 02:58 AM
nested while loop doesn't loop hosefo81 PHP Databases 5 November 12th, 2003 08:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.