Q:

Arithmetic Calculation using C#

0

This Concept is used to Addition, Subtraction, Multiplication, Division and Modules operation.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;
public class addexam
{
public static void Main()
{
int a,b;
int add,sub,mul,div,mod;

Console.Write("Enter the First number : ");
a = Convert.ToInt32(Console.ReadLine());

Console.Write("Enter the Secondt number : ");
b = Convert.ToInt32(Console.ReadLine());

add = a+b;
sub = a-b;
mul = a*b;
div = a/b;
mod = a%b;

Console.WriteLine("Addition\t\t{0}", add);
Console.WriteLine("Subtraction\t\t{0}", sub);
Console.WriteLine("Multiplication\t\t{0}", mul);
Console.WriteLine("Division\t\t{0}", div);
Console.WriteLine("Modulus\t\t{0}", mod);
}
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now