Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

SET-2

1. Design a C program for Blood donation camp. Initialize three parallel arrays:
• An integer array named People-id that is initialized with the peopleid of
10 Persons.
• An integer array named People-age that is initialized with the age of the
10 Persons.
• An integer array named People-weight that is initialized with the weight
of the 10 Persons.
Write a menu driven program to do the following tasks,

a) Among the 10 people, the eligible people should have age > 18 and weight
greater than 45 kgs. Count the number of people who are eligible and not
eligible by displaying the reason for ineligibility.
b) Find all even positive ages in an array People-age and copy them into Array
People-even-age.
c) Read weights from People-weight array and find the frequency of weights and
display the frequency table.

2. On the first day, a store gives d% discount off the price of a certain item. On the day 2, it
gives d% off the day 1 price. On day 3, it gives d% off the day 2 prince and so on. Write
a program that accepts the original price of an item and discount, and determine on what
day, the price drops to less than half the original price.

A sample session follows:


Enter original price : 1000
Enter discount : 10

Day Discount Discounted Price


1 100 900
2 90 810
3 81 729
4 72.9 656.1
5 65.61 590.49
6 59.049 531.441
7 53.1441 478.2969

Day 7 price drops to less than half the price

You might also like