byte
In this chapter you will learn:
byte type
using System; //j a v a2s.c o m
public class Use_byte {
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);
}
}
Min/Max value of byte
The data type defines the max and min values which it can hold.
using System;/* j av a2s . co m*/
class Program
{
static void Main(string[] args)
{
Console.WriteLine(byte.MaxValue);
Console.WriteLine(byte.MinValue);
}
}
The output:
byte hexadecimal literal
using System;//j a va 2 s. c o m
public class Example
{
public static void Main()
{
byte b = 0x00;
b = 0x12;
b = 0x34;
b = 0x56;
}
}
Next chapter...
What you will learn in the next chapter:
Home » C# Tutorial » Byte, Integer, Long