FYBCS C Exercise_1

Set A . Apply all the three program development steps for the following examples. 

 1. Accept dimensions of a cylinder and print the surface area and volume (Hint: surface area =2πr2 + 2πrh, volume = πr2h)

 2. Accept temperatures in Fahrenheit (F) and print it in Celsius(C) and Kelvin (K) (Hint: C=5/9(F-32), K = C + 273.15)

 3. Accept initial velocity (u), acceleration (a) and time (t). Print the final velocity (v) and the distance (s) travelled. (Hint: v = u + at, s = u + at2)

 4. Accept inner and outer radius of a ring and print the perimeter and area of the ring (Hint:perimeter = 2 π (a+b) , area = π (a2-b2) )

 5. Accept two numbers and print arithmetic and harmonic mean of the two numbers (Hint: AM=(a+b)/2 , HM = ab/(a+b) )

 6. Accept three dimensions length (l), breadth(b) and height(h) of a cuboid and print surface area and volume (Hint : surface area=2(lb+lh+bh ), volume = lbh )

 7. Accept a character from the keyboard and display its previous and next character in order.Ex. If the character entered is ‘d’, display “The previous character is c”, “The next character is e”.

 8. Accept a character from the user and display its ASCII value.

Set B . Apply all the three program development steps for the following examples.

 1. Accept the x and y coordinates of two points and compute the distance between the two points.

 2. Accept two integers from the user and interchange them. Display the interchanged numbers.

 3. A cashier has currency notes of denomination 1, 5 and 10. Accept the amount to be withdrawn from the user and print the total number of currency notes of each denomination thecashier will have to give.

Set C. Write a program to solve the following problems

 1. Consider a room having one door and two windows both of the same size. Accept dimensions of the room, door and window. Print the area to be painted (interior walls) and area to be whitewashed (roof).

 2. The basic salary of an employee is decided at the time of employment, which may be different for different employees. Apart from basic, employee gets 10% of basic as house rent,30% of basic as dearness allowance. A professional tax of 5% of basic is deducted from salary.Accept the employee id and basic salary for an employee and output the take home salary of the employee. 

Post a Comment

2 Comments