Click here to Skip to main content
15,914,447 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# question Pin
OriginalGriff4-Mar-13 0:04
mveOriginalGriff4-Mar-13 0:04 
QuestionOffline ActiveX Control for Internet Explorer Pin
NevilPrajapati3-Mar-13 8:16
NevilPrajapati3-Mar-13 8:16 
AnswerRe: Offline ActiveX Control for Internet Explorer Pin
NotPolitcallyCorrect3-Mar-13 9:15
NotPolitcallyCorrect3-Mar-13 9:15 
GeneralRe: Offline ActiveX Control for Internet Explorer Pin
NevilPrajapati3-Mar-13 18:09
NevilPrajapati3-Mar-13 18:09 
SuggestionRe: Offline ActiveX Control for Internet Explorer Pin
Richard MacCutchan3-Mar-13 22:11
mveRichard MacCutchan3-Mar-13 22:11 
GeneralRe: Offline ActiveX Control for Internet Explorer Pin
NotPolitcallyCorrect4-Mar-13 4:23
NotPolitcallyCorrect4-Mar-13 4:23 
AnswerRe: Offline ActiveX Control for Internet Explorer Pin
Shameel4-Mar-13 4:12
professionalShameel4-Mar-13 4:12 
Questionspeech2text. Pin
depak gupta2-Mar-13 19:23
depak gupta2-Mar-13 19:23 
AnswerRe: speech2text. Pin
Peter_in_27802-Mar-13 19:31
professionalPeter_in_27802-Mar-13 19:31 
AnswerRe: speech2text. Pin
Abhinav S3-Mar-13 4:58
Abhinav S3-Mar-13 4:58 
AnswerRe: speech2text. Pin
Thomas Daniels3-Mar-13 6:08
mentorThomas Daniels3-Mar-13 6:08 
QuestionPartial class: is this a bug? Pin
Septimus Hedgehog2-Mar-13 6:52
Septimus Hedgehog2-Mar-13 6:52 
AnswerRe: Partial class: is this a bug? Pin
DaveyM692-Mar-13 7:56
professionalDaveyM692-Mar-13 7:56 
AnswerRe: Partial class: is this a bug? Pin
Dave Kreskowiak2-Mar-13 8:24
mveDave Kreskowiak2-Mar-13 8:24 
GeneralRe: Partial class: is this a bug? Pin
Septimus Hedgehog2-Mar-13 9:34
Septimus Hedgehog2-Mar-13 9:34 
AnswerRe: Partial class: is this a bug? Pin
Alan N2-Mar-13 11:19
Alan N2-Mar-13 11:19 
GeneralRe: Partial class: is this a bug? Pin
Septimus Hedgehog3-Mar-13 7:49
Septimus Hedgehog3-Mar-13 7:49 
GeneralRe: Partial class: is this a bug? Pin
Septimus Hedgehog6-Mar-13 5:53
Septimus Hedgehog6-Mar-13 5:53 
Questioneven numbers table Pin
Yrtsg1-Mar-13 22:11
Yrtsg1-Mar-13 22:11 
I'm trying to create a program that displays a table of all the even numbers within a range given by the user but im having some trouble making it work. the range has to be between 1 and 120. I would also like to incorporate the tryparse method. here is what I have so far:
using System;

public class Range
{

public static void Main(string[] args)
{

int[] range;
string firstNumber;
Console.Write("What is the initial number of the range: ");
firstNumber = Console.ReadLine();
Console.Write("What is the last number of the range: ");
string lastNumber;
lastNumber = Console.ReadLine();
int totalNumber;
int firstNum = Convert.ToInt32(firstNumber);
int lastNum = Convert.ToInt32(lastNumber);
if (firstNum < 1)
{
Console.WriteLine("Error: the firstNumber can't be less than 1.");
}
else if (lastNum > 120)
{
Console.WriteLine("Error: the lastNumber can't be higher than 120.");
}
else if (firstNum >= lastNum)
{
Console.WriteLine("Error: the first number can't be higher than the last number.");
}
totalNumber = lastNum - firstNum;
range = new int[totalNumber + 1];
int tally = 0;

for (int i = 0; i < totalNumber; i++)
{
range[i] = i + 1;

if (range[i] % 2 == 0)
{
Console.Write(range[i] + " ");
}
tally++;

if (tally > 10)
{
Console.WriteLine();
tally = 0;
}
}


Console.Write("\nPress any key to exit program: ");
Console.ReadKey();

}
}
AnswerRe: even numbers table Pin
harold aptroot1-Mar-13 23:29
harold aptroot1-Mar-13 23:29 
QuestionC# Console.ReadLine runns out of memory Pin
dcof1-Mar-13 8:45
dcof1-Mar-13 8:45 
AnswerRe: C# Console.ReadLine runns out of memory Pin
Jibesh1-Mar-13 9:13
professionalJibesh1-Mar-13 9:13 
AnswerRe: C# Console.ReadLine runns out of memory Pin
OriginalGriff1-Mar-13 21:59
mveOriginalGriff1-Mar-13 21:59 
GeneralRe: C# Console.ReadLine runns out of memory Pin
dcof2-Mar-13 8:07
dcof2-Mar-13 8:07 
GeneralRe: C# Console.ReadLine runns out of memory Pin
jschell2-Mar-13 10:26
jschell2-Mar-13 10:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.