C SHARPE

PART-A

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6

PART-B

PROGRAM B1 PROGRAM B2 PROGRAM B3 PROGRAM B4 PROGRAM B5 PROGRAM B6 PROGRAM B7 PROGRAM B8 . . .

2. Develop a C# .NET console application to demonstrate the control statements

 
  
 
 
/*2. Develop a C# .NET console application to demonstrate the control statements */

 using System;
using System.IO;
using System.Text;

namespace IncludeHelp
{
    class Test
    {
        // Main Method 
        static void Main(string[] args)
        {
            //input an integer number and check whether 
            //it is postive, negative or zero
            int number;
            
            Console.Write("Enter an integer number: ");
            number = Convert.ToInt32(Console.ReadLine());

            //checking conditions
            if (number > 0)
                Console.WriteLine("{0} is a positive number", number);
            else if (number < 0)
                Console.WriteLine("{0} is a negative number", number);
            else
                Console.WriteLine("{0} is a Zero", number);

            //hit ENTER to exit the program
            Console.ReadLine();
        }
    }
}