0% found this document useful (0 votes)
13 views2 pages

Choose The Correct Alternative For The Following

The document is an examination paper for the B.Tech 1st semester course CSEN 1001, focusing on programming for problem solving. It includes multiple choice questions, programming tasks, and theoretical questions covering various programming concepts and techniques. Candidates are instructed to answer questions from different groups, with specific requirements for each group.

Uploaded by

Avik Bhadra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Choose The Correct Alternative For The Following

The document is an examination paper for the B.Tech 1st semester course CSEN 1001, focusing on programming for problem solving. It includes multiple choice questions, programming tasks, and theoretical questions covering various programming concepts and techniques. Candidates are instructed to answer questions from different groups, with specific requirements for each group.

Uploaded by

Avik Bhadra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

B.TECH/BT/CE/CHE/EE/ME/1ST SEM/CSEN 1001/2018 B.

TECH/BT/CE/CHE/EE/ME/1ST SEM/CSEN 1001/2018


B.TECH/BT/CE/CHE/EE/ME/1ST SEM/CSEN 1001/2018 (viii) What is the octal representation of (A3B6.DF)16?
PROGRAMMING FOR PROBLEM SOLVING (a)(121666.676)8 (b)(121665.766)8
(CSEN 1001) (c)(121656.676)8 (d)(121676.776)8.
(ix) Select the fastest memory unit.
Time Allotted : 3 hrs Full Marks : 70 (a)Cache (b)RAM (c)Hard disk (d)Register.
(x) In which part of the program compilation process macros are dealt with?
Figures out of the right margin indicate full marks. (a)Assembly (b) Pre-processing
Candidates are required to answer Group A and (c)Linking (d) None of the above
any 5 (five) from Group B to E, taking at least one from each group. Group – B
2. (a) A float type variable X is assigned the decimal value of −14.25. What is the
Candidates are required to give answer in their own words as far as
representation of X using the single-precision 32-bit floating point format
practicable. IEEE-754 standard?
Group – A (b) Draw a flowchart to print all the prime numbers ranging from 101 to 200.
(Multiple Choice Type Questions) 7 + 5 = 12
3. (a) Convert from one number system to the other:
1. Choose the correct alternative for the following: 10 × 1 = 10 (i) (29.65)=(?)2
(i) #define sqr(a) a*a (ii) (364364364)8=(?)16
x = 5; (iii) (10110.0101)2=(?)10
y = sqr(x+2); (b) Calculate:(FACE)16 – (FEE)16
Value of y is (c) Calculate:(10010)2 – (111)2
(a) 49 (b) 17 (c) 94 (d) 71. (d) Calculate the following in binary 2’s complement sign magnitude form:
(19)10 + (-25)10
(ii) Which of the following is equivalent to y = y * 2, (data type of y is int)?
(a) y = y << 1 (b) y = y << 2 (c) y = y >> 1 (d) y = y >> 2. (2  3) + 1 +1 + 4 = 12
Group – C
(iii) If your program contains a line #define M 20, then, within the program
4. (a) Rewrite the following if-else ladder using switch-case:
(a) M can be assigned to zero only (b) only M-- is allowed if (num == 1)
(c) M can never be changed (d) only M++ is allowed. strcpy(word, "ONE");
(iv) What will be the output? else if (num == 2)
#include <stdio.h> strcpy(word, "TWO");.
else if(num == 3)
int main() strcpy(word, "THREE");
{ else
int x = printf(“%s”, “KOLKATA”); printf("Incorrect");
printf(“%d”, x);
return 0; (b) When is it not possible to convert an if-else ladder to switch-case?
} (c) Write a program to check whether a number is a palindrome or not, without
(a) syntax error (b) 7 (c) runtime error (d) 0 (zero). using array.
3 + 3 + 6 = 12
(v) Which one of the following declarations is invalid?
(a) int 2A (b) int A2A (c) int A2 (d) int AA2. 5. (a) Write an iterative C program to find the GCD of two numbers. Now write a
recursive C program to solve the same problem. Which one will you prefer to
(vi) What will be the value of c? int a = 5, b = 6; int c = ++b - a++; solve the above problem and why?
(a) 0 (zero) (b) 2 (c) -2 (d) 11 . (b) What is ternary operator? Explain with one example.
(vii) Assuming the number in a 2's complement form (8-bit), the decimal (c) Write the differences between "break" and "continue" statements with
equivalemt of (10101011)2 is examples.
(a) +171 (b) +85 (c) -85 (d) -43. (3+ 2 + 1) + (1 + 3) + 2 = 12
CSEN 1001 1 CSEN 1001 2
B.TECH/BT/CE/CHE/EE/ME/1ST SEM/CSEN 1001/2018 B.TECH/BT/CE/CHE/EE/ME/1ST SEM/CSEN 1001/2018
Group – D
6 .(a) Write a program in C to find the product of two matrices. First input the
matrices, print them in matrix format, then check whether multiplication is
possible or not; if possible, multiply the matrices and print the result in matrix
format, otherwise print proper message.
(b) Consider the following function prototype: 4
void swap(int*, int*);
Write the body of the function and use it to swap two integers. Write the driver
program to implement the function.
(c) What are void pointer and null pointer?
6 + 4 + 2 = 12

7. (a) Implement the following function with the prototype given below
int exponent (int x, int y);
This function will evaluate and return xy if there is no overflow. Otherwise in
case of overflow(i.e value out of range for integer),the function will return 0.
(b) Write a C program to reverse any number, using recursion.
(c) How does a local static variable behave differently from a local variable in a
function?
4+ 6 + 2 = 12
Group – E
8. (a)Write a program in C to count and print total number of characters in a text file.
Also print the last n characters from the file. (n is a user input).
(b) Create a structure to store the name, mobile number and the marks of student.
Create an array to store the details for five students and print the details of the
student whose marks is maximum.
(3 + 3) + 6 = 12

9.(a) Explain the meaning of the following declarations:


int (*a)[10];
int *a[10];
(b) Write a function in C to find both maximum and minimum of some integers
stored in an array. The function takes the array and size of the array as
parameters and returns both the maximum and minimum values of the array.
Write the driver program to test the function.
2 +10 = 12

CSEN 1001 3 CSEN 1001 4

You might also like