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

Multiple If Statement Homework Help

Sometimes we need to Execute Statements with different conditions. Say for example:
In the website of Indian Railways, while you are booking an online ticket, following discounts on the tickets are there:

If age of passenger is less than 5 years then 100% discount.
If age of passenger is more than 5 but less than 12 years then 50% discount.
If age of passenger is more than 12 but less than 26 years then 10% discount.
If age of passenger is more than 60 years then 25% discount.

The following example will illustrate this problem:


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

if (age <= 5)
{
printf(“you have 100% discount on your ticket.”);
}
if ((age > 5) && (age <= 12))
{
printf(“you have 50% discount on your ticket.”);
}

if ((age > 12) && (age <= 26))
{
printf(“you have 10% discount on your ticket.”);
}

if (age > 60)
{
printf(“you have 25% discount on your ticket.”);
}
return;
}

In the above example && is used, which is Logical Operator. This means, If first statement and also second statement is true then only the statement will be executed.

Multiple 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