Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

1.

Wap to perform operations of a calculator (all primitive operations


‘+’, ‘-’, ‘*’, ‘/’ ).

2. Wap to calculate simple and compound interest when rate, principal and
time is given

3. Ramesh's basic salary is input through the keyboard. His dearness


allowance is 40% of basic salary, and house rent allowance is 20% of
basic salary. Write a program to calculate his gross salary.

4. If the marks obtained by a student in five different subjects are


input through the keyboard, find out the aggregate marks and
percentage marks obtained by the student. Assume that the maximum
marks that can be obtained by a student in each subject is 100.

5. Temperature of a city in Fahrenheit degrees is input through the


keyboard. Write a program to convert this temperature into Centigrade
degrees

6. If a five-digit number is input through the keyboard, write a program


to calculate the sum of its digits. (Hint: Use the modulus operator
'%')
7. If a four-digit number is input through the keyboard, write a program
to obtain the sum of the first and last digit of this number.

8. In a town, the percentage of men is 52. The percentage of total


literacy is 48. If total percentage of literate men is 35 of the total
population, write a program to find the total number of illiterate men
and women if the population of the town is 80,000

9. A cashier has currency notes of denominations 1, 2, 5, 10, 50 and 100.


If the amount to be withdrawn is input through the keyboard, find the
total number of currency notes of each denomination the cashier will
have to give to the withdrawer.

10. Two variables a and b contain values 10 and 20. Write a


program to interchange the ontents of a and b with using a third
variable.

11. Two variables a and b contain values 10 and 20. Write a


program to interchange the ontents of a and b without using a third
variable.

12. If a five-digit number is input through the keyboard, write a


program to print a new number by adding one to each of its digits. For
example if the number that is input is 12391 then the output should be
displayed as 23502.

13. If the total selling price of 15 items and the total profit
earned on them is input through the keyboard, write a program to find
the cost price of one item.

14. Any integer is input through the keyboard. Write a program to


find out whether it is an odd number or even number.

15. If cost price and selling price of an item is input through


the keyboard, write a program to determine whether the seller has made
profit or incurred loss. Also determine how much profit he made or
loss he incurred.

16. Any year is input through the keyboard. Write a program to


determine whether the year is a leap year or not.

17. Write a program to find the greatest of the three numbers


entered through the keyboard.

18. A five-digit number is entered through the keyboard. Write a


program to obtain the reversed number and to determine whether the
original and reversed numbers are equal or not.

19. If the ages of Ram, Shyam and Ajay are input through the
keyboard, write a program to determine the youngest of the three.

20. Write a program to check whether a triangle is valid or not,


when the three angles of the triangle are entered through the
keyboard. A triangle is valid if the sum of all the three angles is
equal to 180 degrees.

21. Find the absolute value of a number entered through the


keyboard.Like if value is -12.32 abs value is 12.32 and if value is -9
abs value is 9.
22. Given the length and breadth of a rectangle, write a program
to find whether the area of the rectangle is greater than its
perimeter. For example, the area of the rectangle with length = 5 and
breadth = 4 is greater than its perimeter.

23. Wap to calculate amount of a telephone bill for the following


criteria. Calls charge per call (Rs.)
a) 1-150 0
b) 151-250 .9
c) 251-400 1.2
d) 401 onwards 1.5
24. Wap to calculate amount of a electricity bill for the
following criteria. Units charge per unit (Rs.)
a) 1-100 0
b) 101-200 1.5
c) 201-400 2.5
d) 401 onwards 3.5
25. If the three sides of a triangle are entered through the
keyboard, write a program to check whether the triangle is isosceles,
equilateral, scalene or right angled triangle.

26. In a company, worker efficiency is determined on the basis of


the time required for a worker to complete a particular job. If
the time taken by the worker is between 2 & 3 hours, then the worker is
said to be highly efficient. If the time required by the worker is
between 3 & 4 hours, then the worker is ordered to improve speed. If
the time taken is between 4 & 5 hours, the worker is given training to
improve his speed, and if the time taken by the worker is more than 5
hours, then the worker has to leave the company. If the time taken by
the worker is input through the keyboard, find the efficiency of the
worker.
27. A university has the following rules for a student to qualify
for a degree with A as the main subject and B as the subsidiary
subject:
(a) He should get 55 percent or more in A and 45 percent or more in B.
(b) If he gets less than 55 percent in A he should get 55 percent or
more in B. However, he should get at least 45 percent in A.
(c) If he gets less than 45 percent in B and 65 percent or more in A he
is allowed to reappear in an examination in B to qualify.
(d) In all other cases he is declared to have failed.

28. The policy followed by a company to process customer orders is


given by the following rules:
(a) If a customer order is less than or equal to that in stock and has
credit is OK, supply has requirement.
(b) If has credit is not OK do not supply. Send him intimation.
(c) If has credit is Ok but the item in stock is less than has order,
supply what is in stock. Intimate to him data the balance will be
shipped.

Write a C program to implement the company policy.

29. Using conditional operators determine:


(1) Whether the character entered through the keyboard is a lower case
alphabet or not.
(2) Whether a character entered through the keyboard is a special
symbol or not.

30. write a program to decide division of a student as following


rules.
(1) There are 5 paper in each semester
(2) Maximum marks may vary for each paper
(3) if below then 40% for any two paper result is fail.
(4) if below then 40% for any paper result paper due.
(5) if total % below 33% result fail.
(6) if total % between 33% to 45% result third division.
(7) if total % between 45% to 60% result second division.
(8) if total % between 60% to 70% result first division.
(9) if total % above 70% result PASS WITH HONS.

31. A certain grade of steel is graded according to the following


conditions:
(i) Hardness must be greater than 50
(ii) Carbon content must be less than 0.7
(iii) Tensile strength must be greater than 5600

The grades are as follows:


Grade is 10 if all three conditions are met
Grade is 9 if conditions (i) and (ii) are met
Grade is 8 if conditions (ii) and (iii) are met
Grade is 7 if conditions (i) and (iii) are met
Grade is 6 if only one condition is met
Grade is 5 if none of the conditions are met

Write a program, which will require the user to give values of


hardness, carbon content and tensile strength of the steel
under consideration and output the grade of the steel.

32. A library charges a fine for every book returned late. For
first 5 days the fine is 50 paise per day, for 6-10 days fine is one
rupee per day and
above 10 days fine is 5 rupees per day. If you return the book after 30
days your membership will be cancelled. Write a program to accept the
number of days the member is late to return the book and display the
fine or the appropriate message.

33. If the three sides of a triangle are entered through the


keyboard, write a program to check whether the triangle is valid or
not. The triangle is valid if the sum of two sides is greater than the
largest of the three sides.

34. Write a program to find the factorial value of any number


entered through the keyboard.

35. Wap to check whether a given integer no. is palindrome or not.

36. Wap of find LCM and HCF of two numbers.

37. Write a program to print out all Armstrong numbers between 1


and 500. If sum of cubes of each digit of the number is equal to the
number itself, then the number is called an Armstrong number. For
example, 153 = ( 1 * 1 * 1 ) + ( 5 * 5 * 5 ) + ( 3 * 3 * 3 )

38. Write a program to find out how many days and how many weeks
have passed between the dates. Also find out how many days could not
get evened out into weeks.(e.g. days passes between 01/01/92 to
31/05/92)

39. Write a program to enter the numbers till the user wants and
at the end it should display the count of positive, negative and zeros
entered.
40. Write a program to find the octal equivalent of the entered
decimal number.
41. write a program to find the range of a set of numbers. Range
is the difference between the smallest and biggest number in the list.

42. Write a program to print all prime numbers from 1 to 300. (Use
nested loops, break and continue)

43. Write a program to fill the entire screen with a smiling face.
The smiling face has an ASCII value 1.

44. Write a program to add first seven terms of the following


series using a for loop:

1 2 3
a.- + - + - ......
1! 2! 3!

b. 1,2, …….,n terms


C. 1,3,5,7,…..n terms
d. 2,4,6,8,…..n terms
e. 1,2,4,7,11,……..n terms
f. 0, 1, 1, 2, 3, 5, 8,…….n terms(Fibonacci series)

45. Write a program to generate all combinations of 1, 2 and 3


using for loop.
46. According to the Gregorian calendar, it was Monday on the date
01/01/1900. If any year is input through the keyboard write a program
to find out what is the day on 1st January of this year.

47. Two numbers are entered through the keyboard. Write a program
to find the value of one number raised to the power of another.

48. Write a program to print all the ASCII values and their
equivalent characters using a while loop. The ASCII values vary from 0
to 255.

49. Write a program to print all the ASCII values and their
equivalent characters using a for loop. The ASCII values vary from 0
to 255.

50. Write a program that, for all positive integers i, j , k, and


l from 1 through 1000, finds and prints all combinations of i, j , k,
and I such that i + j + k = l and i < j < k < l.
51. Write a program to calculate overtime pay of 10 employees.
Overtime is paid at the rate of Rs. 12.00 per hour for every hour
worked above 40 hours. Assume that employees do not work for
fractional part of an hour.

52. Draw the pattern.

1234
123
12
1

Flow chart questions


1. If a four-digit number is input through the keyboard, write a
program to obtain the sum of the first and last digit of this
number.
2. Any integer is input through the keyboard. Write a program to
find out whether it is an odd number or even number.

3. Any year is input through the keyboard. Write a program to


determine whether the year is a leap year or not.

4. Write a program to find the greatest of the three numbers entered


through the keyboard.

5. A five-digit number is entered through the keyboard. Write a


program to obtain the reversed number and to determine whether
the original and reversed numbers are equal or not.

6. Write a program to check whether a triangle is valid or not, when


the three angles of the triangle are entered through the
keyboard. A triangle is valid if the sum of all the three angles
is equal to 180 degrees.

7. Given the length and breadth of a rectangle, write a program to


find whether the area of the rectangle is greater than its
perimeter. For example, the area of the rectangle with length = 5
and breadth = 4 is greater than its perimeter.

8. If the three sides of a triangle are entered through the


keyboard, write a program to check whether the triangle is
isosceles, equilateral, scalene or right angled triangle.

9. Using conditional operators determine:


(1) Whether the character entered through the keyboard is a lower case
alphabet or not.
(2) Whether a character entered through the keyboard is a special
symbol or not.
10. Wap to check whether a given integer no. is palindrome or not.

11. Write a program to enter the numbers till the user wants and
at the end it should display the count of positive, negative and
zeros entered.

12. Write a program to calculate overtime pay of 10 employees.


Overtime is paid at the rate of Rs. 12.00 per hour for every hour
worked above 40 hours. Assume that employees do not work for
fractional part of an hour.

13. Write a program to print all prime numbers from 1 to 300.

14. Write a program to find the octal equivalent of the entered


decimal number.

15. If the total selling price of 15 items and the total profit
earned on them is input through the keyboard, write a program to
find the cost price of one item.

You might also like