|
-
October 12th, 2009, 04:46 PM
#1
console application help
Hi everyone! I am new here and I am new in C# (started to learn it his year at Uni). I hope you won't mind to help me with my homework. I got the console application to do. the task says
"Write a program to output the numbers 1 to 20 inclusive, excluding the numbers 5 and 18". I did it, but it shows all the numbers starting from 1 till 20, and I can't think how to make it right. Please help! Thank you!
-
October 12th, 2009, 05:08 PM
#2
Re: console application help
So, we don't usually do homework for people here, but it seems to me that you would simply check for the numbers '5' and '18' and not print them...
-
October 12th, 2009, 05:23 PM
#3
Re: console application help
hi thanx for reply. All i need just a hint how to do it as i stuck. the program should output (as i understand it) numbers in a row 1-till 20 excluding 5 and 18.
-
October 12th, 2009, 05:29 PM
#4
Re: console application help
ok, so...
Code:
for ( int i = 1; i < 21; ++i )
{
if ( i != 5 && i != 18 )
{
Console.WriteLine( i );
}
}
-
October 12th, 2009, 05:33 PM
#5
Re: console application help
aaaaaaaa!! Thank you!! (grrr! so easy!)
i study it 1st month as i am 1st year student. Sorry to bother you. I will try to find some other forum for the beginners. Thanx again!
-
October 12th, 2009, 05:36 PM
#6
Re: console application help
It's ok, you don't have to find another forum. We are glad to help students with their homework, we just prefer not to hand them an answer. Next time, just post some code which shows what you have already tried, tell us what the problem is, and we will help you think through it.
-
October 12th, 2009, 05:43 PM
#7
Re: console application help
Thanx mate! I'm really appriciated!! I was thinking since yesterday, and now it is so easy so i think how could I not do it??!!
Thanks a lot!
-
October 12th, 2009, 06:18 PM
#8
Re: console application help
 Originally Posted by BigEd781
We are glad to help students with their homework, we just prefer not to hand them an answer.
But you did just hand them the answer As this is the first month of learning how to program, they really should be checking their notes for this kind of stuff. It's far too early to start getting handed the answers online, they might get lazy!
www.monotorrent.com For all your .NET bittorrent needs
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
-
October 12th, 2009, 06:24 PM
#9
Re: console application help
hehe I promise i won't ask for answers anymore and I will work hard
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|