Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 2

PROBLEM SET 1

1. WAP to print your name and surname.


2. WAP to find average of three numbers. Take three number as input from the user.
3. Write a program
a. To calculate the area and perimeter of square having side S.
(Hint area=side*side, perimeter =4*side)
b. To calculate the area and perimeter of rectangle having length L and breadth B.
(Hint area=length*breadth, perimeter =2*(length + breadth)
4. WAP to calculate the area of circle of radius R.
(Hint Area=pr2.)
5. WAP to interchange the values of the given two integer variables A and B
b. Using a temporary
c. Without using temporary variable
6. WAP to calculate volume of cube whose side is given by integer variable L.
7. WAP to convert the temperature from °F to °C. Note that the temperature may be
real number.
(Hint °C=(5/9)(°F-32))
8. WAP that reads the time from the user as hours, minutes and seconds. Assuming
that the time is entered correctly. Print the time in a standard 24 hours format. This
program illustrates the use of simple I/O functions printf( ) and scanf( ).
9. Read from the customer the number of tickets purchased and the amount paid by
the customer. Calculate the total amount to be paid by the customer. You can assume
fixed cost for every ticket. Also print the balance to be given back to customer.
10. WAP to calculate the area of triangle whose base and altitude are given by integer
variables B and H respectively .( Hint area=(1/2)(base *height))
11. WAP to display the number of seconds that have elapsed since midnight. The
program will take the current time as input. The current time will be provided in terms of
hours, minutes and seconds.
12. WAP to input an amount in terms of rupees. The program should output as to how
many 100,50,20,10,5,2 and 1 rupee notes can the amount consist of.
13. A farmer has a field, which is B meters and L meters long. The field yields C
cubic meters of grain per hectare (1 hectare=10,000 square meters). The farmer has a
number of rectangular tins L1 meters long, B1 meters wide and H1 meters high to store
the grain. WAP to find the number of tins required to store the yield.
14. WAP to find out the number of tins of paint required to paint the room. The room
is B meters wide .L meters long, H meters high. It has a door (B2 meters wide and H1
meters high) in one wall and a window (B2 meters wide and H2 meters high) in another.
The walls and ceiling of this room are to be painted. X sq. meters of the wall can be
painted with each tin of paint. The values for B, H, L etc will be real. A real answer will
be acceptable.
15. WAP to compute the salary to be paid to an employee. The salary consists of the
salary plus overtime. The overtime rate is Rs. 20/- per
hour. Read as input the time devoted by the employee and the overtime.
16. WAP to display the number of seconds between the time values. The program will
Pace Infotech
24 Shanti Nagar ,DCM Ajmer Road Jaipur 302019, +91-9828041224
www.paceinfotec.com , paceinfotecjaipur@gmail.com
take time T1 and time T2 as inputs. The time will be provided in terms of hours, minutes
and seconds. Assume that the date does not change in between the time interval.
17. Write a program
a. To calculate the sum of three digit number.
b. To calculate the sum of four digit number.
c. To calculate the sum of first and last digit of three digit number.
d. To calculate the sum of first and last digit of four digit number.
18. The distance between two cities is input through the keyboard. WAP to convert
and print this distance in meters, feet, inches and centimeters.
19. WAP to output total money in a coin box. The number of 50,25,20,10 and paise
coins present in the box will be provided as input. The output should be in terms of
rupees.
20. WAP to compute the current time from the number of seconds that have elapsed
since midnight.

Pace Infotech
24 Shanti Nagar ,DCM Ajmer Road Jaipur 302019, +91-9828041224
www.paceinfotec.com , paceinfotecjaipur@gmail.com

You might also like