15,917,176 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 12141172 (Top 12 by date)
Member 12141172
22-Nov-15 21:16pm
View
thank you!!
YES, need to add the Console.ReadLine(); (bad programming form)
Member 12141172
22-Nov-15 20:17pm
View
ok.
Member 12141172
22-Nov-15 20:16pm
View
Even like this, I get no output (I know the Boolean values should always be true).
static void Main(string[] args)
{
// declare boolean values
bool icyRain = true;
bool tornadoWarning = true;
if ((icyRain) & (tornadoWarning))
{
Console.WriteLine();
}
else if ((!icyRain) && (!tornadoWarning))
{
Console.WriteLine("Let's go outside!");
}
}
}
}
Member 12141172
22-Nov-15 20:11pm
View
I tried adding an else statement and it also didn't work.
Member 12141172
22-Nov-15 19:49pm
View
Thank you for your response! I am still not sure what the problem is:
I tried it both with & and &&, and the output is still blank.
Yes, I want both values to be false.
Member 12141172
16-Nov-15 20:32pm
View
well, with the proper indents, which did not transfer well on my reply.
Member 12141172
16-Nov-15 20:32pm
View
BillWoodruff, thank you so much your suggestion worked and this is what my final code was, which ran correctly, as asked of my Professor:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace For1_100EvenOddV2
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i <= 100; i++)
{
if (i % 2 == 0)// declare as even
{
Console.WriteLine(i);
Console.WriteLine("It's even");
}// end if
else
{
Console.WriteLine(i);
Console.WriteLine("It's odd");
}// end if else
}
}
}
} // end For1-100EvenOdd
Member 12141172
16-Nov-15 15:34pm
View
thank you, appreciate the feedback. not sure why i have the "if" in the "else" - my textbook seems to indicate it is written as such. i am happy to remove it!
i will learn more about the ternary operator.
Member 12141172
16-Nov-15 15:33pm
View
thank you all for such insightful help. as a "newbie" i have absolutely no beliefs, but clearly you believe you know everything. if you aren't going to offer help, don't offer anything. your comments classify you as bullies. which, is what most IT people are, as they hide behind their screens. thanks again for validating what most people think of the "professionals" in this field.
Member 12141172
16-Nov-15 15:30pm
View
It's a problem for an online class I'm taking. Sarcastic and/or rude comments aren't necessary though I thank you for your suggestion.
Member 12141172
16-Nov-15 15:24pm
View
thank you so much i will try this.
Member 12141172
16-Nov-15 15:24pm
View
ok, thanks. i will do that next time.
Show More