Saturday, November 7, 2015

C# DECISION BASED PROGRAMM

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace posneg
{
    class positive
    {
        int a;
        public void read(int x)
        {
            a = x;
        }

        public void find()
        {
            if (a > 0)
            {
                Console.WriteLine("Postive Number");
            }
            else
            {
                Console.WriteLine("Negative Number");
            }
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            Console.WriteLine("Enter Number ");
            n = Int32.Parse(Console.ReadLine());

            positive obj=new positive();
            obj.read(n);
            obj.find();

            Console.ReadKey();
        }
    }
}



No comments:

Post a Comment

Make Code Arcade : Area of Circle

  Make Code Arcade : Area of Circle Editor Simulator