If Else
If Else
C++ Program to take a value from the user as input any character and check whether it is
the alphabet, digit or special character. Using if-else.
2. C++ Program to take a value from the user as input the month number and print number
of days in that month. Using if-else.
3. Write a program to swap the values of two number if values of both variables are not the
same using if-else statement
4. Using the if-else, C++ Program to take a value from the user as input electricity unit
charges and calculate total electricity bill according to the given condition: For the first
50 units Rs. 0.50/unit………….For the next 100 units Rs. 0.75/unit…..For the next 100
units Rs. 1.20/unit ……………For unit above 250 Rs. 1.50/unit………An additional
surcharge of 20% is added to the bill…….Using if-else.
5. Input the Salary of an employee and make the following deductions before printing it
out:
If salary is less than or equal to 10,000 then no deduction are done.
If salary is more than 10,000 and less than 25,000 then deduct Rs. 1,000.
If salary is equal to or more than 25,000 then deduct 5 % of the salary.
Test with salary=25,000 and 10,000.
6. Find out whether the input number is even or odd and if the number is even, display
its square and if the number is odd display the cube.
7. Ask the user for his/her age and display the message according to the following
criteria: