100 HUNDRED PROGRAMMING QUESTIONS COLLECTIONS [QBASIC MODULAR
PROGRAMMING, QBASIC FILE HANDLING, C PROGRAMMING COLLECTIONS]
1. Write a program in QBASIC that asks two numbers to find remainder using SUB…END SUB
program and product of two numbers using FUNCTION…END FUNCTION.
2. Write a program in QBASIC that ask to enter any three different numbers then find out the product
and average. Create a user defined function PROD() to calculate product and sub procedure AVG() to
calculate average.
3. Wise a program in QBASIC that asks any number and display its square and square root: Create a
user- defined function to calculate square root and a sub program to display the square of a number.
4. Write a program in QBASIC that asks length, breadth and height of room and calculate its area and
volume. Create a user defined function to calculate area and sub-program to calculate volume. Hint:
[A=L×B], [V=L×B×H]
5. Write a program in Q-BASIC that asks length and breadth of a room and calculate its area and
perimeter. Create a user-defined FUNCTION to calculate area and SUB program to calculate perimeter.
[Hint: A=L×B, P=2(L+B)]
6. Write a program to calculate area of rectangle using FUNCTION and area of a circle using SUB.
7. Write a program to calculate area of a circle using SUB..... END SUB and perimeter of rectangle
using FUNCTION... END FUNCTION.
8. WAP to Find area of Four walls using FUNCTION END FUNCTION and area of rectangle using
SUB END SUB
9. Write a program in QBASIC that asks radius and height of a cylinder Create a User Defined
Function to calculate total surface area and a Sub Program to calculate the volume of a cylinder.[Hint:
TSA=2pr (r+h) and Volume pr2h]
10. Write a program in QBasic that ask the radius and height of a cylinder and calculate the volume and
curve surface area. Create a user-defined function to calculate volume and sub-procedure to calculate
curve surface area of a cylinder. [Hints: V=πr2 h, CSA=2πrh]
11. Write a program in Qbasic that ask the radius of a hemisphere and calculate its volume and total
surface area. Create a user-defined function First(r) to calculate volume and sub-procedure Second(r) to
calculate total surface area of a hemisphere. [Hints: TSA=3pr2, V=2/3pr3)
12. WAP in SUB procedure to find the volume of cylinder and in function procedure to find the area of
circle in Qbasic. [vol=pir2h, area=pir2]
13. Write a program in QBASIC that asks height and radius of cylinder and calculate its volume by user
define function and total surface area by sub procedure.
14. Write a program in QBASIC that allow user to enter radius of a circle. Create a user defined
FUNCTION…END FUNCTION to find volume of cylinder and SUB…END SUB to find
circumference of a circle.
15. Write a program in QBASIC that asks radius of a circle to calculate its area and circumference.
Create a user defined function to calculate area and sub program to calculate circumference.[Hint A=
pr2, C= 2pr]
16. Write a program in QBASIC that ask the radius of circle. Write a program to calculate the area and
circumference of a circle. Create a user defined function first (r) to calculate area and sub procedure
second (r) to calculate circumference of a circle.
17. WAP that asks principal, time and rate of interest and calculate simple interest using SUB..END
SUB and amount using FUNCTION..END FUNCTION. [Hint : SI =P*T*R/100, Amount = P+SI].
18. Write a program in QBASIC to display the greater number using a function procedure and the
smaller number using a sub procedure among three numbers.
19. Write a program to create a sequential data file "[Link]" to store 10 students name and obtain
marks in four different subjects.
20. Write a program to store Roll no., Name, Class and Address of any five students
21. Write a program to create a sequential data file “[Link]” to store programmer’s name, salary and
post according to the need of the user.
22. Write a program to store records regarding the information of Book number, Book’s name and
Writer’s name in a sequential data file called “[Link]”.
23. Write a program to create a sequential data file “[Link]” to store employees’ name, address,
age, gender and salary.
24. Students' name, class, section and address are stored in a data file called "[Link]" Write a
program to print all the records of students.
25. A sequential data file called “[Link]” contains roll number, name, English, Nepali, and Maths
field. Write a program to display all the content of the data file.
26. A sequential data file "[Link]" has records with field name, address, age and salary. WAP
to display only those records whose age is greater than 26.
27. Employee's name, address, gender and salary are stored in the "[Link]" sequential data file.
Write a QBASIC program that displays all information about personnel whose salaries exceed 60000.
28. A data file “[Link]” contains the information of employee regarding their name, post and salary.
Write a program to display all the information of employee whose salary is greater than 15000 and less
than 40000
29. A sequential data file called “[Link]” has stored data under the field headings: Roll No., Name,
Gender, English, Nepali, Maths and Computer. Write a program to display all the information of those
students whose marks in English is more than 40.
30. A sequential data file called “[Link]” has stored data under the field heading Roll No., Name,
Gender, English, Nepali, Maths and Computer. Write a program to display all the information of those
students whose gender is “F” and obtained marks in computer is more than 90.
31. WAP to ask student's name, class and marks secured in three subjects. Store the data in a sequential
data file “[Link]” along with total marks. Make provision to ask user to enter another record.
32. A sequential data file called “[Link]” has stored data under the field heading Name, Class,
Address and Age. Write a program to display all the information of those whose class is 10 and gender
is “male”.
33. A data file "[Link]” has stored records of few employers with EmpID, name, address post and
salary. Write a program is display all the records of the employees whose address is "Nepal" and salary
is than 40.000.
34. Write a program to read the data from the file "[Link]" and display their NAME, EMPID,
POST whose POST is Clerk.
35. A sequential data file called "[Link]" has stored data under the field heading student's name, eng,
nep and math. Write a program to display all the record whose marks is greater than 35 in all subjects
36. A sequential data file called ‘[Link]’ has stored data under the field heading item name, quantity
and rate. Write a program to display all the records with total.
37. Write a program to open data file [Link] which may contain name, address, phone no. and salary.
The program should allow user to add few records on it.
38. A data file “[Link]” consists of book’s name, author’s name and price of books. Write a program
to count and display the total number of records present in the file.
39. A sequential data file “[Link]” contains name, post and salary fields of information about
employees. Write a program to display all the information of employees along with tax amount (also tax
is 15% of salary)
40. A sequential file "[Link]" contain Name, Age and mobile number of few persons. Write a
QBASIC program to display the name of those persons who are eligible to cast the vote. [ Age must be
18 or above to cast the vote.]
41. A sequential data file called "[Link]" has stored data under the field heading items name quantity
and rate. Write a program to update all the records by increasing the rate by 10%.
42. A sequential data file "[Link]” contains the name, address, salary of employees, and displays the
record of those whose salary is more than 37000 and whose name ends with "DHA.
43. Write C program to find average number of any two numbers.
44. Write a program in C language to ask to enter two numbers and find out the sum and product.
45. Write a program in 'C' language to find simple interest where user need to input Principle, Rate and
Time.
46. Write a program in C language to ask length, breadth and height and display volume of box
47. Write a program in C language that asks a number and check whether it is odd or even.
48. Write a program in C language that asks for an integer value and checks whether it is divisible by 7
or not.
49. Write a program in C language to input a number then check whether the number is fully divisible
by 5 or not.
50. Write a C program to test whether the given number is exactly divisible by 13 or not.
51. Write a program in C language to enter a number and find out whether it is positive or negative
52. Write a C program that asks a number and check whether it is negative, positive or zero.
53. Write a program in C language that asks any two numbers and displays the greatest among them.
54. Write a program to read any three integer numbers from the keyboard and find the smallest number
using C-Language.
55. WAP to read two numbers and display the smaller one using C-Program
56. Write a progam is C language to check the students whether that are pass or fail, when the pass
mark is 45
57. Write a program in C language to input length of three rods and display whether the triangle can be
formed by those rods or not.
58. Write a program in C language that asks the value of 3 sides of a triangle then check whether
triangle is Scalene or not.
59. Write a program in C language to display the series with their sum.1, 2, 3, 4 upto 10th terms.
● 60. Write a program in C-language to display the series 2, 4, 6, 8 up to the 10th term.
61. Write a program in C language to display the series with their sum 1, 4, 9, 16.... up to 10th term.
62. Write a program in C language to display first 10 odd numbers.
63. Write a C program to display the sum of first 20 even number.
64. Write a program to print first 10 natural number using C language.
65. Write a program in ‘C’ language to find the sum of first ten natural numbers.
66. Write a program in C to sum of odd number from 80 to 90.
67. Write a program in C language to display the series with their sum 40, 41, 42, 43…….10th terms.
68. Write a program in C language to display the odd numbers from 1000 to 500 with their sum.
EXTRA
69. WAP in SUB procedure to find whether the input number is Armstrong or not in Q-basic.
70. WAP in SUB procedure to enter a number and find the reverse of a number.
71. WAP to find the sum of digits of a number using SUB….END SUB.
72. WAP in SUB procedure to enter decimal number and find the binary number in QBASIC.
73. WAP in Q-basic to enter a number and check whether the number is positive, negative or zero using
FUNCTION procedure.
74. Write a FUNCTION program to check whether the supplied number is divisible by 5 or not.
75. Write a program to ask a number and check it is exactly divisible by 3 and 7 using
FUNCTION..END FUNCTION.
76. Write a program to ask a number and check it is exactly divisible by using 4 and 6 using
SUB…END SUB.
77. Write a program to accept age and citizen of a person to check whether he/she is eligible to cast
vote or not using SUB…END SUB.
78. WAP to find the greatest number out of three numbers using FUNCTION….END FUNCTION.
79. Write a program to count the occurrence of letter ‘e’ in the supplied string using SUB…END SUB.
80. Write a program to count the occurrence of letter ‘a’ in the supplied string using SUB…END SUB.
81. Write a program to declare SUB procedure to print only the vowels from a given word.
82. Write a program to find the numbers of vowels in an input string using ‘FUNCTION…..END
FUNCTION’.
83. Write a program using FUNCTION….END FUNCTION to input a string and count the total
number of consonants
84. Write a program using FUNCTION.....END FUNCTION to count the number of words in a
sentence
85. Write a program using FUNCTION….END FUNCTION to get a word from the user and print the
word in the reverse order.
86. Write a program to check whether a string is palindrome or not using SUB….END SUB.
87. Write a program in QBASIC to display sum of first natural numbers using FUNCTION…END
FUNCTION.
88. Using SUB……….END sub, write a program to print the following serial 9, 7, 5,……1
89. Write a program using sub procedure module to print the series 1,1,2,3,5,8.. up to ten terms.
90. Write a program using SUB…END SUB to print the first ten odd numbers.
91. Write a program to print the natural numbers from 1 to 5 using SUB…END SUB
92. Using FUNCTION……END FUNCTION, write a program to calculate distance travelled by a
body. (Hint: s=ut+ (1/2) at2)
93. Write a program using Function Module to calculate and print the volume of a box.
94. Write a program to calculate the area of four walls using SUB…END SUB.
95. Write a program in QBASIC to find the total surface area of a box using FUNCTION….END
FUNCTION.
96. Write a program using Function…..End Function to get temperature in Celsius from the user and
then print the temperature in Fahrenheit.(hint: F=9C/5+32).
97. WAP to print the sum of the digits of a given numbers using SUB Procedure
98. Write a program using FUNCTION…END FUNCTION to find area of the triangle
99. Write a program using a SUB procedure module to print the multiplication table of any input
number up to 10th term
100. Using Functions……End Functions Write a program to find odd or even