C# Conditional Constructs Exercise

In this chapter you will learn

How to solve programming problems using conditional constructs in C#. There are some programming exercises are given below. Do the exercises and improve your programming skills in conditional constructs.

Qu1:Write a program of tax calculation. Accept money as input from the user and calculate the tax using following pattern.
Money Percentage Total Tax
Less than 10,000 5% ?
10,000 to 100,000 8% ?
More than 100,000 8.5% ?
 
Qu2:Write a program for library management system in which display the user option and based on option shows them available book.
Option:
c: for computer books
m: for mathematical books
h: for history books
e: for English books

If user input wrong value then shows them message try again and serve the input prompt again using goto label statement.

Summary

In this chapter, you learned how to solve programming problems using conditional constructs in C#. In next session, you will know about various C# Statements.

More Articles

 

Share your thought



PLEASE DISABLE ADBLOCKER AND SUPPORT US!

Please support us by enabling ads on this page. Refresh

YOU DON'T LIKE ADS, WE ALSO DON'T LIKE ADS!
 
But we have to show ads on our site to keep it free and updated. We have to pay huge server costs, domain costs, CDN Costs, Developer Costs, Electricity and Internet Bill. Your little contribution will encourage us to regularly update this site.