Program 17 #P17 -// Program to check whether an integer entered by the user is odd or even #C129
How if...else statement works?
If test expression is evaluated to true,
statement(s) inside the body of if statement is executed
statement(s) inside the body of else statement is skipped from execution.
If test expression is evaluated to false,
statement(s) inside the body of else statement is executed
statement(s) inside the body of if statement is skipped.
When user enters 7, the test expression ( number%2 == 0 ) is evaluated to false. Hence, the statement inside the body of else statement printf("%d is an odd integer"); is executed and the statement inside the body of if is skipped.
#rubalsolutions #coding #developer #programming #programmer #technology #clanguage #computerscience #c #informaticpractices #sub #subscribe #youtube #newyoutuber #youtubechannel