• +1-617-874-1011 (US)
  • +44-117-230-1145 (UK)
Online Customer Service
Follow Us:

If Statement Homework Help

Syntax is as follow:

if (condition)
{
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.

Example of If Statement:

#include <stdio.h>
#include <conio.h>
void main()
{
int i;
printf(“Enter an integer: ”);
scanf(“%d”,&i);

if (i<=0)
{
printf(“\nYou have entered a non-positive integer”);
}
return;
}

In C any non-zero quantity is considered as true. Now look at following examples:

if (10)
{
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.


If Statement Homework Help

Topics in C Programming

PLACE ORDER NOW

Resources

  • 24 x 7 Availability.
  • Trained and Certified Experts.
  • Deadline Guaranteed.
  • Plagiarism Free.
  • Privacy Guaranteed.
  • Free download.
  • Online help for all project.
  • Need Assignment Help

Testimonial

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:
Read More

Tap to Chat
Get Instant Assignment Help
Tap to Chat
Get Instant Assignment Help