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
What is an interface and what is an abstract class? Please, expand by examples of using both. Explain why.   In a interface class, all methods are abstract without execut

Full time contractual programming position (mostly scraping, databasing) Project Description: This is a full time contractual role needed for a sports advisory service. We ar

We previously use Site content filtering inside Netkiosk But at present this blocks sites. or keywords We now also require a Whitelist that allows. 1) An entire domain www

What is a Metadata?  Metadata is information about a PE. In COM, metadata is communicated through non-standardized type libraries. In .NET, this data is contained in the header

What is the use of attribute  ? This attribute works as a compatibility option. We know that ASP worked in STA model and ASP.NET works in MTA model, but what if your ASP.NET

Describe the services that UDDI provides to Web applications. UDDI gives the following types of services to a Web application: XML Schema for business descriptions - Contain

Briefly explain how the server control validation controls work? A validation control works by evaluating the value of an input server control on the page to see whether it mee

how can we use entity framework in ASP.Net MVC

What is black box testing & White box testing? The Black box testing is also termed as functional testing. It ignores how the internal functionality of a system works & depends

What are the different types of triggers in SQl There are 2 types of triggers in the SQL server 2000 :- 1) INSTEAD OF triggers: The INSTEAD OF triggers fire in place of