Update two parameters in for loop : for « Language Basics « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » Language Basics » forScreenshots 
Update two parameters in for loop
 

using System;
   
class CommaOp1
{
    const int StartChar = 33;
    const int EndChar = 125;
    const int CharactersPerLine = 5;
   
    static public void Main()
    {
        for (int i = StartChar, j = 1; i <= EndChar; i++, j++)
        {
            Console.Write("{0}={1} ", i, (char)i);
            if (== (j % CharactersPerLine))
            {
                Console.WriteLine("")
            }
        }
    }
}

 
Related examples in the same category
1.Simplest forSimplest for
2.For loop for array
3.The finished C# statement Help system that processes multiple requestsThe finished C# statement Help system       that processes multiple requests
4.Determine smallest single-digit factorDetermine smallest single-digit factor
5.A negatively running for loopA negatively running for loop
6.Determine if a number is prime. If it is not, then display its largest factorDetermine if a number is prime.  If it is not,     then display its largest factor
7.loop with letter char as the control variable
8.Use commas in a for statememtUse commas in a for statememt
9.Use commas in a for statememt to find the largest and smallest factor of a numberUse commas in a for statememt to find     the largest and smallest factor of a number
10.Loop condition can be any bool expression
11.Parts of the for can be emptyParts of the for can be empty
12.Move more out of the for loopMove more out of the for loop
13.The body of a loop can be emptyThe body of a loop can be empty
14.Declare loop control variable inside the forDeclare loop control variable inside the for
15.Using break to exit a loopUsing break to exit a loop
16.Use continueUse continue
17.Demonstrate the for loopDemonstrate the for loop
18.Compute the sum and product of the numbers from 1 to 10. Compute the sum and product of the numbers from 1 to 10.
19.For Loop TesterFor Loop Tester
20.If inside a forIf inside a for
21.For without init valueFor without init value
22.For without increaseFor without increase
23.For with empty conditionFor with empty condition
24.a for loop to display 1 to 5a for loop to display 1 to 5
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.