Ex: While loop: Void main() { int i = 1; While( i <= 10) { Console.WriteLine(i +" "); i++; } Console.ReadLine(); }
Write(): Write is a predefined member of console class. This method will print the given value on command prompt window after printing the value it will not move the cursor to next line it will keep the cursor in the same line to print next value. Class Console { Write() { } }
Iteration: Executing a block of statements in one time can be called as one itteration.
3. Do while loop: Syntax:
Do { Statement 1; Statement 1; ++/-- } while(<condition>);
Eg: Do while: Void main() { int i= 1; Do { console.write(i +" "); i++; } While(i <= 10); Console.ReadLine(); }
Data Types: Every programming language will have its own data type, similarly every .Net language will have its own data types.
Data types specifies the types of the data and size of the data.
According to type of the data and size of the data C#.Net data types are classified into five types.
1. Numerical data types. 2. Floating Point. 3. Character related data types. 4. Logical data types. 5. General data types.
Which can be called as primitive data types.
Above 1, 2, 3, 4 data types are having the predefined sizes but 5th data type is not having the predefined size that means general data type is not having the pre-defined sizes that means pre-defined sizes.