Program for assigning the values to variables, DOT NET Programming

Program for Assigning the Values to Variables

Hello i am unable to find the code of assigning the values to variables in c#. Please write a program for me of assigning  values  to  Variables in C#.

 

Posted Date: 2/11/2013 4:33:56 AM | Location : United States





Please try this once.

Program - Assigning values to variables

using System; 

class SampleMath 

  public static void Main() 

  { 

   double x = 2.0;                        // declaring a variable named x of type double & assigning it value 2.0 

   double y = 3.0;                        // declaring a variable named y of type double & assigning it value 3.0 

   double z ;                                 // declaring a variable named z of type double 

   z = x + y;  

   Console.WriteLine("x = " + x + ", y = " + y + " & z = " + z); 

   Console.ReadLine(); 

  } 

Posted by Harry | Posted Date: 2/11/2013 4:48:11 AM

Hi. Thank you for this example. I look forward to going through your other program codes. I''ve been trying to look up this kind of stuff on the? web and its a pain. Thank you for your expert Advice.

Posted by Jack | Posted Date: 2/11/2013 4:52:22 AM


Related Discussions:- Program for assigning the values to variables, Assignment Help, Ask Question on Program for assigning the values to variables, Get Answer, Expert's Help, Program for assigning the values to variables Discussions

Write discussion on Program for assigning the values to variables
Your posts are moderated
Related Questions
This assignment requires you to design, develop and implement a token web application. It is intended to assess your mastery of the web application development concepts and ASP.NET

Explain Compare Validator and Range Validator Compare Validator uses Control To Validate, Control To Compare and operator properties to compare a control's value with another

Question: (a) How can you simple-bind controls at design mode? (b) How can a blank record be created in a dataset bound to the controls in a Windows form? (c) Datagrid

What is Common Language Specification (CLS)? CLS is a set of essential rules, which must be followed by each .NET language to be a .NET- compliant language. It enables interope

How do we access attributes using "XmlReader"? The below snippets represents the way to access attributes. At First in order to check whether there any attributes present in th

Write a XML with database with book details (BOOK ID, Title, Author, subject, published Year, language, vendor, price)

What is Multi-threading? Multi-threading process forms the subset of Multi-tasking. Inspite of having to switch between programs this feature switches between different parts o

How do we access view state value of the page in the next page? The View state is page specific; it contains information about controls embedded at the particular page. ASP.NET

Show the code for the file dependency in cache? Partial Class Default_aspx Public Sub displayAnnouncement() Dim announcement As String If Cache("announcement") Is Noth

IT governance defined In this section, a short literature survey will be conducted. The results will be presented in a final comparative table. Before starting defining IT gove