how to write an if else program
Answers
Explanation:
if user inputs valid account number and pin, then allow money withdrawal. If statement works like "If condition is met, then execute the task". It is used to compare things and take some action based on the comparison. As a programmer you must have a good control on program execution flow.
Answer:if...else is a branching statement. It is used to take an action based on some condition. For example - if user inputs valid account number and pin, then allow money withdrawal.
If statement works like "If condition is met, then execute the task". It is used to compare things and take some action based on the comparison. Relational and logical operators supports this comparison.
C language supports three variants of if statement.
Simple if statement
if...else and if...else...if statement
Nested if...else statement
As a programmer you must have a good control on program execution flow. In this exercise we will focus to control program flow using if...else statements.
Explanation: