C program to check if number is odd or even
belongs to collection: C programs - Basic C Programs
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
belongs to collection: C programs - Basic C Programs
total answers (1)
C program to check if number is odd or even - Source code
Program Output
Program Explanation
Modulus operator in C programming language, denoted by %, returns the remainder after the division operation. Here we have perform the modulus operator on the number provided by the user and checked whether it is equal to zero(n%2 == 0). The if statement is executed automatically if the expression inside it returns true value. Otherwise, the else statement is executed.