Problem: Write a program to determine whether a given number is odd or even and print the message ‘Number is Even’. or ‘Number is
Decision Making Statements – Lab 1 (How to write a C# program to find whether a given year is a leap year or not)
Arrays
In a simple definition, an array is a collection of elements having the same data type stored in sequence in contiguous memory loc
Looping – For loop
For loop is used when you want to repeat the set of statements or commands at a fixed number of times. That means you have already
Looping – Do while loop
Syntax: do { // statement or statements // to be executed }while(); Lets have a look at the syntax of do while loop. It starts wit
Looping – While loop
Syntax: while(<conditional expression>) { // statement or statements // to be executed } Lets have a look at the above synta
Looping Introduction
Sometimes programmer has to write the code to repeat the same statement or statements for certain number of times or until any con
Decision Making Statements – Switch statement
Syntax: switch(<expression>) { case <value 1>: // statement or statements break; case <value 2>: // statement or
Decision Making Statements – If else if statement
Syntax: if(<conditional expression 1>) { // statement or statements to be executed // when conditional expression 1 returns
Decision Making Statements – If else statement
Syntax: if(<conditional expression>) { // statement or statements to be executed // when conditional expression returns // t