Credit:Eli TamangEli Tamang

Tribhuwan University

Institute of Science and Technology

2081

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.
What is loop? Differentiate between break and continue statement. Write a program to find sum of first N natural numbers. [6+4]
2.
What is pointer? How it differs from array? Write a program to add two 2D matrices. [4+6]
3.
What is string? Explain any three string function in "string.h" header file in C with example. Write a program to check whether a word is palindrome or not. [2+3+5]
Section B

Short Answers Questions

Attempt any Eight questions.
[8*5=40]
4.
What are conversion specifiers? Explain the compilation of C program in brief. [2+3]
5.
What is structure? Write a program to read roll, name and marks of 10 students using structure and then display all records. [1+4]
6.
Explain if else ladder with syntax and semantic. Write a program to find largest among 3 different numbers. [2+3]
7.
Write a program to check whether a given number is Armstrong number or not. [5]
8.
What is operator precedence? Explain assignment and logical operator. [1+4]
9.
Explain call by reference of a function with suitable example. [5]
10.
Write a program to write N numbers in file "number.txt" and then read it and display only even numbers. [5]
11.
What is constant? Explain basic data types in C programming along with their range. [1+4]
12.
Write short notes on: a) Union b) Switch statement [0+2.5+2.5]