Perform arithmetic operations - c# program, DOT NET Programming

Assignment Help:

Perform Arithmetic Operations - c# Program

Hello, i didn't find the correct way of using arithmetic operations in c#. I am beginner for this language. Please suggest me some examples.


Related Discussions:- Perform arithmetic operations - c# program

Cmmi levels, What is CMMI? This is a collection of instructions an orga...

What is CMMI? This is a collection of instructions an organization can follow with the purpose to gain the better control over its software development process. According to

What are the naming conventions required for xml elements, What are the nam...

What are the naming conventions required for XML elements tags? The following are the naming conventions that need to be followed for XML elements tags: Element names should

Difference between panel and group box classes, Difference between Panel an...

Difference between Panel and Group Box classes? Panel & Group box both can used as container for other controls like radio buttons & check box. the difference in panel & group

Define common type system, What is Common Type System (CTS)? CTS is the...

What is Common Type System (CTS)? CTS is the component of CLR by which .NET Framework provides support for multiple languages because it have a type system that is common acros

Shared (vb.net)/static(c#) variables, What are shared (VB.NET)/Static(C#) v...

What are shared (VB.NET)/Static(C#) variables? Shared/Static classes are used when a class gives functionality which is not specific to any instance. In brief if you want an ob

Reading strings from the keyboard, Reading strings from the keyboard   ...

Reading strings from the keyboard   using System; class Prog3_1 {       public static void Main()   {    Console.Write ("Enter Your First Name : "); // Displaying to writ

Benefits and limitation of viewstate for state management, What are benefit...

What are benefits and Limitation of using Viewstate for state management The benefits of using Viewstate are as follows:- 1)    There is no server resources required because

What is machine.config, What is Machine.config?  Machine configuration ...

What is Machine.config?  Machine configuration file: The machine. config file have settings that apply to the entire computer. This file is located in the %runtime install path

Describe the rules creating a well-formed xml document, Describe the rules ...

Describe the rules and regulations that must be followed whereas creating a well-formed XML document. The following are the rules and regulations that are essential to follow w

2/11/2013 6:30:30 AM

Hey this a very easy code for your problem try this.

Perform Arithmetic Operations

using System;  

class integerdemo {

  public static void Main()

 {  

   string s1,s2;

   int a,b;  

  Console.Write("Enter no 1 # "); // Display to enter no. 1

  s1 = Console.ReadLine ();           // save the number in a string variable s1

  a = int.Parse (s1);                      // the string s1 is converted into int type variable  

  Console.Write("Enter no 2 # "); //Display to enter no. 2

  s2 = Console.ReadLine ();        // save the number in a string variable s2

  b = int.Parse (s2);                     // the string s2 is converted into int type variable

   // Here er converted both the string variables to int because we wanted to do 

   // integer / numeric manipulation with the inputted string variables

   Console.WriteLine(""); // Blank line

  Console.WriteLine("*** Integer manipulations ***");

  Console.WriteLine(""); // Blank line

                                   // Integer manipulations

   Console.WriteLine("No1 + No2 = " + (a+b));

  Console.WriteLine("No1 - No2 = " + (a-b));

  Console.WriteLine("No1 / No2 = " + (a/b));

  Console.WriteLine("No1 * No2 = " + (a*b));

  Console.WriteLine("No1 % No2 = " + (a%b));

   Console.ReadLine();  

 }

}

Edward

2/11/2013 6:32:27 AM

Thanks it was very useful. I was?looking for this. Everything is ok and cleared.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd