I just have started learing C. getting some problems. how can I solve this program?

I’ve given it in the ans section…cz it’s not showing properly here… TIA! :slight_smile:

A cloth showroom has announced the following seasonal discounts on purchase of items:

        Purchase amount                                                       Discount                        
                                                           Mill cloth                     Handloom items
         0-100                                                                                   5%
        101-200                                            5%                               7.5%
        201-300                                           7.5%                             10.0%
        Above300                                       10.0%                            15.0%

Write a program using switch and if statements to compute the net amount to be paid by a coustomer.

What are you exactly asking? This seems to be a very simple problem.

I want the solution… if you can, plz help me! :slight_smile:

Have you tried it yourself yet? Show us your take on problem. What is your solution(even wrong or incomplete)? Asking for code is a bad practice. This is not how you learn programming. Try yourself first. How would you approach the problem? If it seems overwhelming, break it down to smaller and simpler problems. Solve each one of them one by one.

i just have started learning C.That too only 2 days ago. I’m not getting it! that’s why I’m asking for help…

Are you familiar with the basic constructs of C? Like control flow, conditionals, loops, functions, arrays, strings, pointers(not in too much depth, but necessary for understanding). Don’t jump too soon. Programming is supposed to be taken seriously and can frustrating at times. Just asking for code will always make you a bystander. Have you ever learnt any other language beside C? How? And if not, its absolutely ok to go slow.

What are you not getting in C? Leave the coding aside for now.