Model Set 1
Published by: Anil K. Panta
Programming Language
Short Answer Question:
Write any two differences between formatted and unformatted input/output.
What do you mean by string?
Write down the difference between break and continue statement.
Write down the difference between * and &.
What is a pointer
Write down the difference between structure and union.
What are different types of modes in file handling?
Write down the syntax to open a file.
What is a ternary operator? Write down its syntax.
Write down the syntax for function declaration and function call for a function with return type and argument.
Descriptive Answers Question (Any Five):
What do you mean by algorithm and flowchart? Develop an algorithm and draw a flowchart to find the greatest among four numbers.
What do you mean by recursive function? WAP to find a factorial of a number using recursive function.
Write down a program to display following pattern:
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:
“Grade A” if mark >= 90
“Grade B” if mark >= 80 and mark < 90
“Grade C” if mark >= 70 and mark < 80
“Grade D” if mark < 70
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.
WAP to read two 4x4 matrices, find the sum of two matrices and display it.
Case Analysis
WAP to read 3 numbers from the user and do the following:
Find the largest among them. [7.5]
Check if the largest number is even or odd. [7.5]
WAP to do the following:
Create a file named “student.txt” and write a content “Welcome to the file” [5]
Append new content and display in the console. [5]
Clear all the data and write “All previous data is cleared” [5]