Posts

Showing posts from December 10, 2017

Conditions, Relational Operators:

Image
Conditions, Relational Operators:  In programming, decision making is used to specify the order in which statements are executed. In this tutorial, you will learn to create decision making program using if...else statements. C if statement if (testExpression) { // statements } The  if  statement evaluates the test expression inside the parenthesis. If the test expression is evaluated to true (nonzero), statements inside the body of  if  is executed. If the test expression is evaluated to false (0), statements inside the body of  if  is skipped from execution. To learn more on when test expression is evaluated to nonzero (true) and 0 (false), check out  relational  and  logical operators . Flowchart of if statement Example #1: C if statement // Program to display a number if user enters negative number // If user enters positive number, that number won't be displayed #include <stdio.h> int main () { int number ; printf