Write a program to find the sum of diagonal elements of n*n matrix.[5]
Control Structures
1.
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.[4+6]
2.
Write a program to display the following pattern using the string "NEPAL".
N
NE
NEP
NEPA
NEPAL
[5]
Elements of C
1.
How keyword is different from Variables? Discuss Basic data types with its ranges.[5]
File Handling
1.
How do you include a file to another file? Illustrate with an example.[5]
Functions
1.
List the advantages and disadvantages of global variable. Assume the two data files "numl.txt" and "num2.txt" containing integers. Merge these two files to the third file named " file3.txt". Here, the integers of " file3.t-xt" must be written in sorted order.[10]
2.
Write a program with a function that takes an array as an argument and returns its sum to the main function.[5]
Introduction
1.
What do you mean by flowchart? Draw a Flowchart to find the largest among three numbers entered by user.[5]
Operators and Expressions
1.
What is operator associativity? Explain conditional and Logical operators in brief.[5]
Pointers
1.
Why array and pointer is similar? Write a program to show the similarity between an array and pointer.[5]
Structure and Unions
1.
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]
The C Preprocessor
1.
Write short notes on: a) Macro vs FunctionWrite short notes on: b) Break vs Continue[2.5+2.5]