Wednesday, 17 May 2017

How to rum simple calculator in C# console Application

1. AddSubMultiMode.cs File

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

namespace ConsoleApplication1
{
    class AddSubMultiMode
    {
        static void Main(string[] args)
        {
            int a, b, c;
            a = 5;
            b = 6;
            c = a + b;
            Console.Write("c=" + c);
            Console.WriteLine();
            c = a - b;
            Console.Write("c=" + c);
            Console.WriteLine();
            c = a * b;
            Console.Write("c=" + c);
            Console.WriteLine();
            c = a / b;
            Console.Write("c=" + c);
            Console.WriteLine();
            c = b % a;
            Console.Write("c=" + c);
            Console.WriteLine();
            //c=a\b;
            Console.ReadLine();
        }
    }
}

0 comments

Post a Comment