TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Josip Pavic
NA
20
10.8k
Beginner need help
Nov 11 2011 7:07 AM
Can you tell me what is wrong with this IF statement??
I think I mix something with operators.
namespace exercise1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
int age;
age = int.Parse(textBox1.Text);
if (age < 17)
{
MessageBox.Show("You're still a youngster.");
}
if (age <= 25)
{
MessageBox.Show("Fame beckons!");
}
if (age <= 40)
{
MessageBox.Show("There's still time.");
}
if (age > 40)
{
MessageBox.Show("Oh dear, you've probably missed it!");
}
}
}
}
Thanks for help!!!
Reply
Answers (
7
)
Calculator problem
Beginner problem