Bachelors Level/First Year/First Semester/Science bit/first semester/c programming/syllabus wise questions

Bachelors In Information Technology

Institute of Science and Technology, TU

C Programming (BIT102)

Year Asked: 2077, syllabus wise question

Arrays and Strings
1.
What do you mean by multi-dimensional array? Write program logic to add and display the sum of two m x n matrices. [5]
2.
Find errors (If any) in the following program and rewrite it.

$\# \text{define (studio,h)}$

$\text{float main < >}$

$\text{int m [ ] [ ] = {{ 1,2,3,4}};}$

$for (i = 4, I>=0 ; i--)$

$for (j=0, j <4; j++);$

$\text{m[i] [j] = a[i][j] + b[i][j];}$

$\text{return 0. 0;}$
$\}$
[5]
3.
Write a C program to check whether a given string is palindrome or not. [5]
Control Structures
1.
Write a program to generate the following pattern of Integers.
$1$

$1 2$

$1 2 3$

$1 2 3 4$

$1 2 3 4 5$
[5]
2.
How break statement is different from continue statement? Explain with suitable example. [5]
Elements of C
1.
What is an Identifier and keyword? Explain the rules for naming valid identifiers in C with example. Write a C program to find sum of digits of a 'n' digit number. [5+5]
File Handling
1.
Why file is used in programming? Explain different file opening modes. [5]
Functions
1.
Explain the role of function in programming. How function is declared, defined and called in C? Write a grogram to find factorial of 'n' using recursive function. [5+5]
Introduction
1.
What is the basic structure of a C program? Explain each part. [5]
Pointers
1.
What is pointer? Illustrate the use of a double pointer with suitable example. [5]
Structure and Unions
1.
How structure is different from union? Write a program to store and display basic information (roll, name, address, email, and phone) of students of using a structure. [10]
The C Preprocessor
1.
Write short notes on: a) Macros Write short notes on: b) Null Pointers [2.5+2.5]