In this program, the user is asked to enter any one of the operators +, -, *, / and also two operands. The operation chosen by the user is carried out on the two operands.
This C program displays the name of the day by asking the user to input a number. For example, if the user enters 1 then “SUNDAY” is displayed, if the user enters 2 then “MONDAY” is displayed and so on. The C program code to display the day name according to number you entered are as follows.
A year that has 366 days is called a leap year.
A year can be checked whether a year is leap year or not by dividing the year by 4, 100 and 400. If a number is divisible by 4 but not by 100 then, it is a leap year. Also, if a number is divisible by 4, 100 and 400 then it is a leap year. Otherwise the year is not a leap year.
To find the largest among 3 numbers entered by the user in C programming, nested if can be used which is implemented in following program:
In any programing language including C#, variables are the memory space in computer where data can be stored. A variable in C# programming is defined by three main features: name, type and value (optional). Let us take an example:
int var = 1;
In above example, var is the name of variable, int is the type of variable var and 1 is the value stored in memory location.
Armstrong number is the number whose sum of cube of individual digits is the number itself. For example: 153, 407 etc.
153 = 13 + 53 + 33 // Armstrong Number
Example: Source Code to Check Armstrong Number
Data type is a categorization of variable to define what type of data can be stored in that variable. In C#, declaration of a data type is compulsory. This helps compiler know what type of data will be stored in that variable.
These data types can be categorized in following three types:
The characters A, E, I, O, U are known as vowels. The remaining 21 characters of English alphabets are known as consonants.
A character is said to be in uppercase if it is in capital letter and it is said to be in lowercase if it is in small letter. C program to check whether an entered character is in uppercase of lowercase is shown below.