Perform arithmetic operation on floating values in c#, DOT NET Programming

Perform Arithmetic operations on Floating Values - C# Program

Hello, I've been trying so many codes for this but those codes didn't work well. Please write the code for Perform Arithmetic Operations on Floating Values in c#.

Posted Date: 2/11/2013 6:40:00 AM | Location : United States





Program code for Arithmetic Operations on Floating Values

using System;

class floatdemo

{

  public static void Main()

 {  

   string s1,s2;

   float a,b;

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

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

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

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

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

  b = float.Parse (s2); // the string s2 is cinverted into float type variable

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

   // float / 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();

  }

}

Posted by Jacob | Posted Date: 2/11/2013 6:41:58 AM

Thanks for your Experts suggestion.

Posted by Bella | Posted Date: 2/11/2013 6:43:18 AM


Related Discussions:- Perform arithmetic operation on floating values in c#, Assignment Help, Ask Question on Perform arithmetic operation on floating values in c#, Get Answer, Expert's Help, Perform arithmetic operation on floating values in c# Discussions

Write discussion on Perform arithmetic operation on floating values in c#
Your posts are moderated
Related Questions
The ASP.NET impersonation is totally controlled by entries in the applications web.config file. Default setting is "no impersonation". You can explicitly describe  that ASP.NET sho

This assignment aims to give you a deeper understanding of a 3-tiers integrated application, which groups together several topics taught in this course. This assignment asks yo

Advertizing Project Description: I am preparing a MLM business. I can need direct mailing and coupon books as a product in my website. Skills required are .NET, C# Program

HWID Spoofed for Windows 7, 8 x64 Project Description: I require a simple program that will spoof my hardware id. I could be able to write the id to spoof to in the program a

Can you give an example of what might be best suited to place in the application_Start and Session_Start subroutines? Application Start - We can place code to initialize

Explain collation sequence in sql server. The Collation sequences are the set of rules which determine how the data is sorted and compared. The Sorting rules can be defined wit

Program of Declaring a function - C# Program Program of Declaring a function, I am looking for a program in C#. It would be great if anyone help me learn function in C# langua

Video wall control app for Ipad and Win7-64 Project Description: We would like a completely functioning PC and IPAD app to control the functions of a videowall processor.

What are the different types of joins? 1) INNER JOIN: The Inner join shows matches only when they exist in both the tables.For example, in the SQL below there are two tabl

I need Beautiful Chatting Application Project Description: I need a beautiful chatting application created that has both private as well as public chat system. The chatting c