The if-else statement executes a block of code if a specific condition is true. If the condition is false then it executes another block of code which is shown in below flow chart.
C language support's following types of if statement:
Exercise and Examples of if-else statement's:
- C program to check given number is zero or not.
- C program to print given number is even or odd.
- C program to find factorial of given number.
- C Program to check number is maximum or minimum or equal between two numbers.
- C program to check maximum number between three numbers.
- C Program to check year is leap year or common year.
- C program to accept three subjects marks and display result.
- C program to print total number of notes in given amount.
- C program to capitalize the given string.
learn more C programming exercises with their solutions...
No comments:
Post a Comment
If you have any doubts, please discuss here...👇