Tribhuwan University

Institute of Science and Technology

2081.2

Bachelor Level / First Year / First Semester / Science

Bachelors in Information Technology (BIT102)

(C Programming)

Full Marks: 60

Pass Marks: 24

Time: 3 Hours

Candidates are required to give their answers in their own words as for as practicable.

The figures in the margin indicate full marks.

Section A

Long Answers Questions

Attempt any TWO questions.
[2*10=20]
1.
Define odd loop. What do you mean by goto and label? Write a program to generate the following pattern.
11
222 2
3333 3 3
44444 4 4 4
[10]
2.
When do we need external function? Illustrate the process of swapping the value of two variables using the concept of pass by value and pass by reference. [3+7]
3.
Differentiate between fgets() and fgetc(). What is the task of typedef? Write a program to define a structure Book with data members name, price and author. Display the names of the book having price greater than 1000. [10]
Section B

Short Answers Questions

Attempt any Eight questions.
[8*5=40]
4.
Write an algorithm and flowchart to test whether the given integer is odd or even. [5]
5.
Define token. Describe any three types of statements. [5]
6.
List any five types of functions for string manipulation with their uses. [5]
7.
What is the task of sizeof and comma operator? Discuss about type conversion. [5]
8.
What is union? Differentiate between pointer and array. [5]
9.
Differentiate between switch statement and if else if ladder. [5]
10.
Give any two types of logical operators. What are formatted and unformatted I/O means? [5]
11.
Define pre-processor. How do you pass pointer as argument? [5]
12.
Write a program to add two 3×3 matrices. [5]