C Programming 2079
Section A
Long Answer Questions
Attempt any TWO questions. [2×10=20]
AI is thinking...
1. List the advantages and disadvantages of global variable. Assume the two data files "num1.txt"
and "num2.txt"
containing integers. Merge these two files to a third file named "file3.txt"
. Here ,the integers in "file3.txt"
must be written in sorted order. [2+8]
AI is thinking...
2. How nested structure is defined and initialized? Explain with an example. Write a program, using structure, to input records of 10 students. Members include name, roll number, marks obtained in math, C Program, and English. Display the records of students who have passed in C Program. [4+6]
AI is thinking...
3. When do we use for
loop and while
loop? Compare the while
and do while
loop with suitable example. Write a program to find average, minimum, and maximum age in a class of 20 students. [2+2+6]
AI is thinking...
Section B
Short Answer Questions
Attempt any EIGHT questions. [8×5=40]
AI is thinking...
4. What do you mean by Flowchart? Draw a Flowchart to find the largest among three numbers entered by the user. [1+4]
AI is thinking...
5. Why array and pointer is similar? Write a program to show the similarity between an array and pointer. [1+4]
AI is thinking...
6. Write a program to find the sum of diagonal elements of an n × n matrix. [5]
AI is thinking...
7. How is a keyword different from a Variables? Discuss Basic data types with their ranges. [1+4]
AI is thinking...
8. What is operator associativity? Explain conditional and Logical operators in brief. [1+4]
AI is thinking...
9. Write a program with a function that takes an array as an argument and returns its sum to the main function. [5]
AI is thinking...
10. How do you include a file to another file? Illustrate with an example. [5]
AI is thinking...
11. Write a program to display the following pattern using the string "NEPAL":
N
NE
NEP
NEPA
NEPAL [5]
AI is thinking...
12. Write short notes on:
a. Macro vs Function
b. Break vs Continue [2×2.5]
AI is thinking...