17 Aug 2017

what is variable in c# with example

What is variable .

A variable is a location in the memory.


Example 
                        user (10,15) 




Syntex- <Data type><variable_name> = <Value>;

int num = 2;

Int = int data type

Num = variable name

2 variable initialization

Data type in c#

Char
Int
Float
Double
Bool
String

Ex- String Name = "Devesh";
Float Marks = 83.56;
Int Age = 14;
Char Vowel = 'M';

Data type support by c#.

Write a program num and msg print.

Class ABC
{
static void main(string[]args)
{
int a,b,c;
a=10;
b=15;
c=a+b;
console.wirite("Sum is :" +c);
console.readline();
}
}
}

No comments:
Write comments

Contact Form

Name

Email *

Message *

© 2014 Rock Programmer . Designed by Bloggertheme9
Powered by Rock Programmer.