Answer to Question #240624 in C for Chakitha

Question #240624
An e-commerce company is planning to give a special discount on all it's products to its customers for the Christmas holidays.

Input:
7
9-13 8-7 18-10
18
Output:
2
1
Expert's answer
2021-09-22T23:43:35-0400
#include <stdio.h>


int main()
{int x;
    printf("Enter a value: ");
    scanf("%d",&x);
    printf("9-13 8-7 18-10\n");
    printf("18\n");
    //printf("2");
    if(x>=9 && x<=13){
        printf("1");
    }
    else if(x>=7 && x<=8){
        printf("2");
    }
    else if(x>=10 && x<=18){
        printf("3");
    }
    
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS