Syntax is as follow:
Statements to be executed;
If the condition is true then only the statement will be executed.
Following expressions are used in the condition:
x = = y if x is equal to y
x ! = y if x is not equal to y
x > y if x is greater than y
x >= y if x is greater than or equal to y
x < y if x is less than y
x <= y if x is less than or equal to y
Note that, here = = sign is used for the comparison not = sign.
printf(“Enter an integer: ”);
printf(“\nYou have entered a non-positive integer”);
In C any non-zero quantity is considered as true. Now look at following examples:
printf(“This statement will be executed”);
In the above example, the statement within () is 10, which is true since it is non zero, hence the statement will be executed.
Urgenthomework helped me with finance homework problems and taught math portion of my course as well. Initially, I used a tutor that taught me math course I felt that as if I was not getting the help I needed. With the help of Urgenthomework, I got precisely where I was weak: