Practical Questions

Model Programming

  1. Write a program using Sub … End Sub to calculate the area and perimeter using Function …..End Function of the rectangle.
  2. Write a program using Sub to check whether the input number is Prime or composite and using Function to check whether it is Armstrong or not.
  3. Write a program using Sub to count the number of digits of the input number and find the sum of all digits by using Function.
  4. Write a program to print Vowels using Sub procedure and to count total numbers of vowels present in supplied strings using Function procedure.
  5. Write a program using Function procedure to take a word from the user and check whether it is Palindrome or not and print in reverse order using Sub procedure.
  6. Write a program using Sub….End Sub check whether the given number is palindrome or not and print it in reverse form using Function .. End Function .

QBASIC File Handling

  1. A data file “hospital.dat” contains information about some staff. The records are staffname, post, shift, age. Write a program to insert 15 records to a data file.
  2. A sequential data file called “Record.txt” has stored data under the field heading Roll No, Name, Gender, English, Nepali, Math and Computer. Write a program to display all the information of those students whose gender are “F” and obtained marks in computer is more than 90.
  3. Write a program to create a sequential data file named “employ.dat” to store Name, Post, Address and Salary for the number of employees. The program should terminate on the user’s choice.
  4. A data file “STAFF.dat” has stored records of a few employees with EmpID, FirstName, LastName, Post and Salary. Write a program to display all the records of the employees whose salary is more than 40,000.
  5. A sequential data file “staff.txt” has several records related to name, post , date of birth (mm-dd-yyyy) and salary. Write a program to display the records of those people who were born between the years 2000 to 2020 as well as count and display the total number of records.

C Program – If Statements

  1. Write a C program to check whether a person is eligible to vote or not.(If the voting age is 18 years.)
  2. Write a C Program to test whether the given number is even or odd.
  3. Write a C program to test whether the supplied number is positive, negative or zero.
  4. Write a C program to find the middle number among three different numbers.
  5. Write a C program to find the greatest among four numbers.

C Program – Looping

  1. Write a C program to display : 1,2,4,7,11,….. up to 10th terms.
  2. Write a C program to display : 0,1,1,2,3,5,8,13,….. up to 20th terms
  3. Write a program in C language to display the series with their sum 1, 2, 3, 4 … up to 10th terms
  4. Write a program in C language to display the series 1,1,2,3,5,8 … up to 10th terms.
  5. Write a C program to display all prime numbers from 1 to 100.

ShareSkills: Computer Knowledge

Design a site like this with WordPress.com
Get started