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

What is the use of a global.asax file in asp.net, Question: (a) Outlin...

Question: (a) Outline four classes that allow you to work with File Streams. (b) (i) What potential problem can arise when you change items stored in an Application State

We need of an expert web developer, Web Developer Project Description: ...

Web Developer Project Description: We need of an expert web developer for long term association, please apply with models if you have the subsequent skills: ASP.NET MVC 3

Indexes, What are indexes? The Indexes in the SQL Server are similar to...

What are indexes? The Indexes in the SQL Server are similar to the indexes in books. They help SQL Server to retrieve the data quickly.These are classified into clustered and n

Is .net is compile time or runtime environment, .NET is Compile Time OR Run...

.NET is Compile Time OR RunTime Environment?   .Net's framework has CLS,CTS and CLR.CTS checks declaration of types at the time when u write code and CLS defines some rules and

Ways of parsing xml document, What are the ways of parsing XML document? ...

What are the ways of parsing XML document? The XML parser sits in between the XML document and the application who want to use the XML document. The Parser exposes a set of wel

I need a custom report - crystal reports, I need a Custom Report - Crystal ...

I need a Custom Report - Crystal Reports Project Description: I am seeking a custom report for our syrinx hire software, all reports are made from Crystal Reports. Skills

What is a host process, What is a host process? A host process is an im...

What is a host process? A host process is an implementable program that hosts a workflow. It might be a Windows Forms application, a Web application, or a Web service applicati

Live chat similar to alibaba seller or buyer chat, Live Chat Similar to Ali...

Live Chat Similar to Alibaba seller/ buyer chat Project Description: I want someone to design and implement for us a live chat program that will be used on our ecommerce webs

Explain some built-in functions of vbscript, Problem: (a) Explain the ...

Problem: (a) Explain the difference between these two lines of ASP codes: (b) The VBScript language includes some built-in functions which are often used in ASP co

How would you implement inheritance using vb.net, How would you implement i...

How would you implement inheritance using VB.NET? When we set out to execute a class using inheritance, we must first begin with an existing class from which we will derive our

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