If/else if problems

Page 1 of 1

1 Replies - 230 Views - Last Post: 18 November 2012 - 09:56 PM Rate Topic: -----

#1 generic_user_1234  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 7
  • Joined: 18-January 12

If/else if problems

Posted 18 November 2012 - 08:54 PM

Hi, i am supposed to make a program that shoots out a appropriate answer to when a value has been added. I am having troubles with this, everytime i try to run the program, it does run, but what happens is that, the same word "freezing" comes up. I cant seem to figure this out. My code is fairly simple! Please if someone could help me out, it would sooo great!! Thank you.
[using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace assign4Part1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
int tempInteger=0;

if (tempInteger <= 32)
{
label2.Text = "Freezing";

}
else if (tempInteger > 80)
{
label2.Text = "Hot";
label2.Focus();
label2.Select();
}

}
}
}
]

Is This A Good Question/Topic? 0
  • +

Replies To: If/else if problems

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10438
  • View blog
  • Posts: 38,651
  • Joined: 27-December 08

Re: If/else if problems

Posted 18 November 2012 - 09:56 PM

Please avoid duplicate posting. Also, please use code tags: :code:.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1