1. |
Write a C program that accepts the length and width of a
rectangle as input and then returns its perimeter and area as output. |
|
|
2. |
Write a C program that inputs an integer and then returns the next three consecutive integers. For example, if the number entered is 12, the output should be 13, 14, 15. |
|
|
3. |
Write a C program that inputs from the user a character and then returns the corresponding ASCII code. Suitable prompt should be given by the program. |
|
|
4. |
Write a C program that converts a lowercase letter to uppercase letter. |
|
|
5. |
Write a C program that converts the height of a man from
inches to feet and inches. For example, 64 inches should be converted to
5 feet 4 inches. |
|
|
6. |
Write a C program that calculates how many coins of each
type a customer has to take if he wants to pay for the exact fare. You may
assume that the customer gets sufficient number of each type of the following
coins: $10, $5 and $1 and he wants to take the smallest number of coins.
For example, if he has to pay $28, then he has to take 2 pieces of $10 coins,
1 piece of $5 coin and 3 pieces of $1 coin. |
|
|
7. |
Write a C program that converts a month from number format
to text format. For example, an input of 4 should yield an output of
"April". Complete your program by using two different approaches:
(a) Use if statement, (b) Use switch statement. |
|
|
8. |
A worker is paid every week at the rate of $60 per hour for
the first 40 hours worked. Thereafter, overtime is paid at 1.5 times the
hourly rate for the next 25 hours and 2 times the hourly rate for further
hours worked. Write a C program to input the number of hours worked per
week, calculate and output his gross wage. |
|
|
9. |
In an examination, English language consists of two papers:
Paper I and Paper II. A student is said to pass if the total score is not
less than 40 and the score for each paper is not less than 15. If he is
absent in either paper, he must score at least 45 marks in the other paper
in order to pass. Write a C program to input the marks of each paper, calculate
and display the total score and tell the user whether he passes or not.
(-1 mark is entered to indicate that a student is absent in the paper.) |
|
|
|
|
|
|