Program that will ask the user to input a number, program will determine and display if the input is odd or even and it will also display all the sum of all even and numbers from the given input.
here's my code so far..
int sum = 0;
for (int i = 0; i <= input; i++)
{
if (i % 2 == 0)
{
sum += i;
lblAllEven.Text = sum.ToString();
lblOutput.Text = "EVEN";
}
else
{
lblAllOdd.Text = sum.ToString();
lblOutput.Text = "ODD";
}
}
please help me fix my code..
1
Expert's answer
2012-12-21T05:51:44-0500
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 WindowsFormsApplication1 { public partial class Form1 : Form { & private int Sum{get;set;} & private int Number{get;set;} & public Form1() & { InitializeComponent(); & }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment