LearnCSIT
Tribhuwan University
Institute of Science and Technology
Model
Bachelor Level/ first Semester/ Science
B.Sc.CSIT
C Programming
Full Marks: 60
Pass Marks: 24
Time: 3 hours
Candidates are required to give their answer in their own words as far as practicable.
The figures in the margin indicate full marks.
Section A
Attempt any TWO questions
1.
Define function and list its advantages. Describe the difference between passing arguments by value and passing arguments by address with suitable program. (4+6)
2.
Explain how structure is different from union? Make a program using structure of booklist having data member's title, author, and cost. Enter four data and calculate total cost. (3+4+3)
3.
Explain various modes in which file can be opened? Write a program to CREATE and WRITE N numbers in a file "NUMBER.TXT". Open this file then read its content and pull all even numbers in one file "EVEN.TXT" and odd numbers in another file "ODD.TXT". (2+4+4)
Section B
Attempt any EIGHT questions
4.
What do you mean by a problem analysis? What are the properties of a good algorithm? Explain the Compilation and Execution of any C program? (1+1+3)
5.
Define nested if else statement with suitable flowchart. Write a C code to check if user given input is exactly divisible by 5 or 11 using nested if else statement? (2+3)
6.
List various binary and unary operators used in C? Write a program that uses a "while" loop to compute and prints the sum of a given numbers of squares. For example, if 4 is input, then the program will print 30, which is equal to 1
2
+2
2
+3
2
+4
2
. (1+4)
7.
"Size of character array is always declared one more than the input size". Justify the statement. Write a program to read a character array input as "TRIBHUWAN UNIVERSITY" from the user and find out how many times a character 'I' occurs in that array? (1+4)
8.
Write syntax to declare and initialize 2-dimensional array? With suitable program logic explain how would you find transpose of 3*3 matrix? (1+4)
9.
Explain the concept of recursive function using the example program to find the factorial of given positive integer. (5)
10.
Describe the fundamental concept of pointer and its arithmetic with suitable examples. (5)
11.
Explain the use of graphical functions. Write a program to draw a triangle using line() graphics function. (1+4)
12.
Write short notes on: (2+3)
a. Dynamic Memory Allocation
b. break and continue