Program for declaration and additions of variables in c#, DOT NET Programming

Program for Declaration and Additions of Variables, I am a learner of C# language and i am struggling with the declaration of variables in C#. Can you have any code examples for this.

Posted Date: 2/11/2013 5:14:34 AM | Location : United States





This is the common problem for almost every new learner of C#. You can understand this code easily, try this.

Program - declaration and additions of variables in c#

using System; 

class DeclareAndDisplay 

      public static void main() 

         { 

             float x; // Declaring x of float type 

             float y; // Declaring y of float type 

             int m;   // Declaring m of integer type 

             x = 75.86F; 

             y = 43.48F; 

             m = x + y; // This line will create an ERROR. Reason given below. 

             Console.WriteLine("m = x + y = 75.86 + 43.48 = " +m); 

         } 

}

Posted by Mike | Posted Date: 2/11/2013 5:19:28 AM

Good One, Never understood this concept before, thanks for helping me.

Posted by Niks | Posted Date: 2/11/2013 5:21:03 AM


Related Discussions:- Program for declaration and additions of variables in c#, Assignment Help, Ask Question on Program for declaration and additions of variables in c#, Get Answer, Expert's Help, Program for declaration and additions of variables in c# Discussions

Write discussion on Program for declaration and additions of variables in c#
Your posts are moderated
Related Questions
Explain Custom Activities. In addition to the standard activities available within the base activity library, you can make new activities to meet exact business needs. Creating

Explain project life cycle. Figure: -Life cycle of a project There are 5 stages of any project initiating, planning, executing, controlling, & closeout. These are the

How can you use Hidden frames to cache client data? This technique is implemented by developing a Hidden frame in page which will have your data to be cached. T cols="100


As its name suggests, the website builder must be a desktop application that will allow users to simply create websites. Essentially, the program will have to give the users with a

Question: (a) The ObjectDataSource control is an alternative design approach to using AccessDataSource or SqlDataSource controls. Explain and illustrate how an ObjectDataSourc

What is the difference between thread and process? The thread is a path of execution which can run on CPU; a process is a collection of threads that share the same virtual memo

Require Guys in Gaming Tracks Company for a mobile game developing Project Description: I want a team of game developers for life-time as mobile dev team in my company. So, i

I need C# AAC sound receiver over WCF Project Description: I want a WCF method which is able to receive a byte stream of an AAC sound file from iPhone device and save it on t

Project Description: PURPOSE Xconnect needs a fully automated system for receiving and processing Terminator cost sheets based on set business principle, convert the accepted