Saturday, August 22, 2020

Positive and Negative Numbers in C#

 A simple program that I wrote using C# to ask the user to give a number and then the program will check and determine whether the given number is a positive or negative number.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;


namespace Positive_and_Negative_Numbers

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }


        private void button1_Click(object sender, EventArgs e)

        {

            int a = 0;

            a = Convert.ToInt32(textBox1.Text);


         if (a >= 0)

            {

                MessageBox.Show("The given number " + a +  " is a Positive Number.",

                 "The Result");

            } else

            {


                MessageBox.Show("The given number " + a + " is a Negative Number.",

                 "The Result");

            }

            

        }


        private void button2_Click(object sender, EventArgs e)

        {

            textBox1.Text = "";

            textBox1.Focus();

        }

    }

}



No comments:

Post a Comment