Model Set 1

Important model question of computer programming

Model Set 1

Model Set 1

Published by: Anil K. Panta

Programming Language

Short Answer Question:

  1. Write any two differences between formatted and unformatted input/output.

  2. What do you mean by string?

  3. Write down the difference between break and continue statement.

  4. Write down the difference between * and &.

  5. What is a pointer

  6. Write down the difference between structure and union.

  7. What are different types of modes in file handling?

  8. Write down the syntax to open a file.

  9. What is a ternary operator? Write down its syntax.

  10. Write down the syntax for function declaration and function call for a function with return type and argument.

Descriptive Answers Question (Any Five):

  1. What do you mean by algorithm and flowchart? Develop an algorithm and draw a flowchart to find the greatest among four numbers.

  2. What do you mean by recursive function? WAP to find a factorial of a number using recursive function.

  3. Write down a program to display following pattern:

1

2 3

4 5 6

*     *     *     *

*     *     *

*     *

*


  1. WAP to calculate a grade based on the mark of a student. The mark should be passed as a parameter to the function. The Grade is calculated as below:

  1. “Grade A” if mark >= 90

  2. “Grade B” if mark >= 80 and mark < 90

  3. “Grade C” if mark >= 70 and mark < 80

  4. “Grade D” if mark < 70

  1. WAP to create a structure named “student” that has name, roll, marks and remarks as members. Assume appropriate data types and size of members. Use this structure to read and display records of 5 students.

  2. WAP to read two 4x4 matrices, find the sum of two matrices and display it.

Case Analysis

  1. WAP to read 3 numbers from the user and do the following:

  1. Find the largest among them. [7.5]

  2. Check if the largest number is even or odd. [7.5]

  1. WAP to do the following:

  1. Create a file named “student.txt” and write a content “Welcome to the file” [5]

  2. Append new content and display in the console. [5]

  3. Clear all the data and write “All previous data is cleared” [5]

We will get back to you via email or phone call