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

Problems for Programming Practices

1. Given 10 values X, find the biggest of them.


2. Given 10 values X, find the smallest of them.
3. Given 10 values X, find the biggest, smallest values and the range
value.
4. Given 10 values X, find the mean.
5. Given 10 values X, find the mean of the values, which do not exceed
35.
6. Given 10 values X, find the mean of the values, which lie between 27
and 53 both inclusive.
7. Find the sum of 1000 natural numbers i.e, positive integers.
8. Find the sum of all odd integers from 1 to 1000.
9. Find the sum of all even integers from 1 to 1000.
10.Find the sum all integers divisible by 3 from 1 to 1000.
11.Find the sum of all integers divisible by 5 from 1 to 1000.
12.Given 10 values X, find the mean of the values, which are integers.
13.Given 10 values X, find the mean of the values, which are non-
integers.
14.Given, 10 values X, find the mean of the values, which non-integers,
not exceeding 95.
15.Given 100 values lying between 0 and 25, sort the values into a
frequency distribution with five equal class intervals, the right-hand
limit being always inclusive.
16.Find the sum of inverse of 1000 natural numbers.
17.Find the sum of factorials of 10 natural numbers.
1 1 1 1 1
18.Find the sum of the series: 1 − + − + − + ....... .......... 1000 terms
2 3 4 5 6
19.Find the sum of the series: 1 + 1 + 2 + 3 + 5 + 8 + 13 + ... 20 terms.
20.Find the sum: 1 + .5 + .52 + .53 + .54 + .......................... 12 terms.
21.Given three numbers, A. B. C prints them in an ascending order.
22. Given three values A. B. C. prints them in a descending order.
23. Given 10 values in list X, sort them in an ascending order.
24. Given 10 values in a list X, sort them in a descending order.
25. Given 10 values, find the mean of the smaller five values, and the
mean
of the five bigger values.
26. Given 11 values in a list, find the middle value when arranged in
order
of magnitude.
27. Given 11 values, find the subranges from the lowest value to the
middle one and from the middle value to the highest value.
28. Find and print all the prime numbers from 2 to 1000.
29. Find the roots of the equation: -(given values of a, b, c).
ax2 + bx + c = 0
30. Input a four digit number, and arrange to print it in the reverse of
digits.
31. Given 10 values, find and print the two values with the least
difference.
32. Given 10 values, find and print the two values with the biggest
difference.
33. Given 10 values, print the values, which are less than the mean of all
ten values.
34. Input name and age of each of 10 different persons and sort the data
into and ascending order of age.
35. Input name and age of each of each of 20 different persons and sort
the data in order of descending age.
36. From the list of 10 persons as in problem-34, find the age of a person
NANNU and print it.
37. Find the names of persons with the minimum age difference in
Problem-
34.
38. From a list of 1000 names, five characters each, find how many are
‘ABDUL’.
39. Given 10,000 alphabetic characters, find the frequency distribution of
the characters—‘A’, ‘B’, ‘C’.
40. Find the biggest value of (- 2x2 + 23x + 57)
48. Create a function to compute the area of a circle and use the function
to find the areas of 5 circles with radii given. Arrange to print the
result with headings and appropriate editing instructions.
49. Create a function to compute the distance between two coordinate
points P (x1, y1) and Q (x2, y2). Use the function to compute
distances between 5 pairs of coordinate points with the coordinates
given.
50. Write a program to process Degree Exam results on the computer.
Assume four subjects of 100 marks each in the examination. A
candidate’s record contains data as follows:

Roll number: : R
Mark in subject 1 : M1
Mark in subject 2 : M2
Mark in subject 3 : M3
Mark in subject 4 : M4

Rules for result processing are as follows:

- Pass mark in each subject = 33


- Aggregate pass mark = 36% (after passing each sub.)
rd
- 3 Divn: less than 45% after passing.
- 2nd Divn: less than 60% and 45% or more after passing each.
-1st Divn: more than 6r equal to 60% after passing in each.

Arrange to print the result of each passed student with the student’s
record containing all relevant input and output data.

51. Rewrite the program above to include referred result processing. A


student is referred in a subject if he failed in that subject only and in
other three subjects as well as in the aggregate.

52. Create input and output files on the disk for problem – 52, and do the
necessary processing from these files.
53. Create all relevant files on the disk for problem – 53 and process
therefrom.
54. Create a pay roll input file on disk with each record containing the
data:

- Identification number : ID
- Basic salary : B
- Allowances : A
- Deductions : D
Create necessary files on disk and process to find PF (10%), gross salary
and the net salary. Arrange to save the output file.

55. Use the output file in problem – 56 to print the payroll records of
persons drawing a gross salary of TK 7,000/ - or above.
56. Develop a suitable frequency distribution of the employees in terms
of their income with TK 1,000. – intervals.


You might also like