Variables and Data Types in C#

 Variables and Data Types in C#


In C#, variables are used to store values. A variable is defined by specifying its data type, followed by its name. C# has several built-in data types such as int, float, double, char, bool, etc. Here's an example code that declares and initializes some variables:


int age = 30;

float salary = 10000.50f;

double pi = 3.14159265359;

char grade = 'A';

bool isMarried = true;

No comments:

Post a Comment

The Importance of Cybersecurity in the Digital Age

 The Importance of Cybersecurity in the Digital Age Introduction: In today's digital age, where technology is deeply intertwined with ev...