Maha

Maha

  • NA
  • 0
  • 329.5k

Without get & set method

Jan 10 2012 8:24 AM
In this program all integers entered must be display like following:

Integers entered12345

How it can be done without using get and set method.

Also I wish to download software to unzip files that has .rar extension. Please name authentic website.

using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int x, num = 0;

int[] integer = new int[5];

for (x = 0; x < integer.Length; ++x)
{
integer[x] = new int();
Console.Write("Enter #{0} interegs ", x + 1);
integer[x] = Convert.ToInt16(Console.ReadLine());
num = integer[x];
}
Console.Write("\nIntegers entered {0, 5}", num);

Console.ReadKey();
}
}
}

Answers (6)