CSIR11-ES-2021-CSIR11ES2021

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

NATIONAL INSTITUTE OF TECHNOLOGY, KURUKSHETRA

THEORY EXAMINATION
ROLL NO.____________

Date of the Examination: 10-03-2021 Programme: ….B.Tech………


Semester…1st ....…………. Subject: Basics of Programming
Course No……CSIR-11……………… Maximum Marks…50………
Number of Questions to be attempted...06… Time allowed ...2 Hours………
Total No. of Questions………06………………. Total No. of Pages used…2….

Instructions: 1. All questions are compulsory.


2. Marks for every part of question are indicated against it.

Q1. (A)Explain the functioning of each unit of computer with the help of block 5
diagram.

(B)What are variables in C language? Write rules for naming any identifier. 3

Q2. (A)Differentiate between break and continue statement with suitable 5


example of each.

(B) Write a program that compares two given dates. To store a date use a
structure that contains three members namely date, month and year. If dates 5
are equal than display the message "EQUAL" otherwise "UNEQUAL".

Q3. 2
(A) Can relational operations be performed on a string? Explain.

(B) What is the null character and what it is used for, in the context of the 2
strings?

(C)WAP to remove all the characters of a string except alphabets. 3

Q4. (A)What are various bitwise operators available in C? How are they 2
different from logical operators?

(B) Find and store transpose of a non-square matrix (i) into a new matrix,
(ii) into itself without using any extra array/matrix. Display the result as 6
row-wise matrix.
Q5. (A)Write a modular program to find sum of 2 matrices. Matrices could be 8
non-square and orders should be read in main. Make separate functions for
(i) reading a matrix (ii) adding two matrices (iii) displaying a matrix

(B)Write a program to print following pattern:


5
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1

Q6. (A) Write a program to generate fibonacci series upto n (i.e. given number) 4
using while loop as well as do- while loop.

You might also like