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

Define importance of vitamin c, Define importance of Vitamin c Freezing...

Define importance of Vitamin c Freezing preserves vegetable and nutrients to a great extent. Vitamin A and β-Carotene are well preserved in spinach, peas and beans, or are mode

Asp.net mvc 4 setup project, I am seeking someone (person or company) who a...

I am seeking someone (person or company) who already has been developing some ASP.NET MVC 4 application with the subsequent requirements (so there is no need to spend extra time to

Add in bitcoin payment option in website, Add in bitcoin payment option in ...

Add in bitcoin payment option in website Project Description: Include bitcoin files to magento for payment options on website. It is just including the files to the magent

Why project needed xml?, Explain why your project needed XML. Remember ...

Explain why your project needed XML. Remember XML was meant to exchange data between the two entities as you can define your user friendly tags with ease. In the real world sce

Difference between system exceptions and application excepti, What is the d...

What is the difference between System exceptions and Application exceptions? All exception is derived from Exception Base class. Exceptions are generated programmatically or ca

Creating a two player web based game, Required: An implementation of...

Required: An implementation of a two player game. Keep the game simple ROCK PAPER SCOSSORS A two player game, each player on a different browser instance.  (pro

Explain different types of xml application programming, Explain different t...

Explain different types of XML Application Programming Interface (API). The following are two main parts of XML parsers: Tree-based API - Compiles an XML document into a tre

Why the javascript validation not run on the asp.net, Why The JavaScript Va...

Why The JavaScript Validation Not Run on the Asp.Net? The Asp.Net Button Is post backed on the server & not yet Submit & when It goes to the server its states is lost so if we

What is a manifest, What is a Manifest?  An assembly manifest have all ...

What is a Manifest?  An assembly manifest have all the metadata needed to specify the assembly's version requirements and security identity, and all metadata required to define

State the differences between the dispose and finalize, State the differenc...

State the differences between the Dispose () and Finalize(). CLR uses the Dispose and Finalize methods to perform garbage collection of run-time objects of .NET applications.

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