PPS Assignment - Conditional Statements
PPS Assignment - Conditional Statements
1. Write a C program to read the value of an integer m and display the value of n is 1 when m is
larger than 0, 0 when m is 0 and -1 when m is less than 0.
Test Case:
Test Data : -5
Expected Output :
The value of n = -1
Test Data : 7 9
Expected Output :
The coordinate point (7,9) lies in the First quadrant.
Test Data : 1 5 7
Expected Output :
Root are imaginary;
No solution
4. Write a C program to read temperature in centigrade and display a suitable message according to
temperature state below
Test Data :
42
Expected Output :
Its very hot.
Test Data :
50 50 60
Expected Output :
This is an isosceles triangle.
Test Data :
k
Expected Output :
The alphabet is a consonant.
7. Write a program in C to calculate and print the Electricity bill of a given customer. The customer
id. and unit consumed by the user should be taken from the keyboard and display the total amount
to pay to the customer. The charge are as follow
Unit Charge/unit
If bill exceeds Rs. 400 then a surcharge of 15% will be charged and the minimum bill should be of Rs.
100/-
Test Data :
1001
800
Expected Output :
Customer IDNO :1001
unit Consumed :800
Amount Charges @Rs. 2.00 per unit : 1600.00
Surchage Amount : 240.00
Net Amount Paid By the Customer : 1840.00
8. Write a program in C to read any day number in integer and display day name in the word.
Test Data :
4
Expected Output :
Thursday