Apr 23, 2020

If-Else statements in C exercises

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:


  1. C program to check given number is zero or not.
  2. C program to print given number is even or odd.
  3. C program to find factorial of given number.
  4. C Program to check  number is maximum or minimum or equal between two numbers.
  5. C program to check maximum number between three numbers.
  6. C Program to check year is leap year or common year.
  7. C program to accept three subjects marks and display result.
  8. C program to print total number of notes in given amount.
  9. C program to capitalize the given string.

learn more C programming exercises with their solutions from codeforhunger... 
Share This:    Facebook Twitter

0 comments:

Post a Comment

If you have any doubts, please discuss here...