|
Subject:
|
ARRAY PROBLEM??? please help ...
|
|
Posted By:
|
mos2128
|
Post Date:
|
9/19/2004 5:04:21 PM
|
i red that we can not find the answers for "beginning visual c#" book exercises. there for can you help me in this ex. in chapter 5 exercise number 5 there is no need towrite i question i think so but here is the code that i wrote as an answer, please informme if it is the right solution for the question:
using System;
namespace ch05myex05
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
int[]number = new int[3];
Console.WriteLine("give me 1 numbers:");
number[0] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("give me 2 numbers:");
number[1] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("give me 3 numbers:");
number[2]= Convert.ToInt32(Console.ReadLine());
Console.WriteLine("here is your {0}are :", number.Length);
int[] tNumber= new int[3];
tNumber[0] = number[2];
tNumber[1] = number[1];
tNumber[2] = number[0];
foreach (int num in tNumber)
{
Console.WriteLine("{0}",num);
}
}
}
}
   thanks in advance
|
|
Reply By:
|
seblake
|
Reply Date:
|
11/2/2004 12:18:48 PM
|
The Chapter 5, Exercise 5 question is "Write a console application that accepts a string from the user and outputs a string with the characters in reverse order". The Chapter 3, Exercise 5 question is "Write a console application that obtains four int values from the user and displays their product".
Your answer does not satisfy either requirement.
All of the exercise answers for "Beginning Visual C#" are now posted in the P2P Forum. Navigate to "P2P Forum > Books > Beginning Visual C# > Beginning Visual C# Exercises - Chapter ?? Answers" where ?? is the chapter number.
|