Use byte to control for loop in CSharp

Description

The following code shows how to use byte to control for loop.

Example


        //from   w  w w  .  j a  v a2 s .co m
 
using System; 
 
public class MainClass {     
  public static void Main() {    
    byte x; 
    int sum; 
 
    sum = 0; 
    for(x = 1; x <= 100; x++) 
      sum = sum + x; 
 
    Console.WriteLine("Summation of 100 is " + sum); 
  }    
}




















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var