Reg.
No
SRM Institute of Science and Technology
Faculty of Engineering and Technology
CYCLE TEST – I Slot F , Batch 2
SET 4
Academic Year: 2022-2023 (EVEN Semester) OFF LINE
Program offered: B.Tech (All Branches) Year / Sem: I/ II
Max. Marks: 50 Time : 2.20 PM to 4.05 PM
Date : 08-03-2023
Course Code and Title: 21CSS101J: Programming for Problem Solving
Course Learning Rationale (CLR):
CLR-1: Think and evolve with a logic to construct an algorithm and pseudo code that can be converted into a program.
CLR-2 : Utilize the appropriate operators and control statements to solve engineering problems
CLR-3 : Store and retrieve data in a single and multidimensional array
Course Learning Outcomes (CLO):
CLO-1: To solve problems through computer programming. Express the basic data types and variables in C
CLO-2 : To use appropriate data types in simple data processing applications. To create programs using the concept of
arrays.
Part A (10*1=10 Marks)
Sl.N Question C P B Mark PI
o O O L s CODE
1 Standard ANSI C recognizes ____________ number of keywords 1 1 1 1 1.6.1
a) 30
b) 32
c) 36
d) 42
2 The format identifier ‘%Lf’ is also used for _____ data type. 1 2 1 1 2.5.2
a) Unsigned Int
b) Double
c) Unsigned Long
d) Long Double
3 Consider the below Algorithm and find the Step Number in which 1 2 1 1 2.5.2
there is an error? Step1: Start
Step 2: Declare variables num1, num 2 and sum.
Step 3: Read values num1and num2.
Step 4: Add num1 and num2 and assign the result to sum.
Sum=num1+num 2
Step 5: Read sum
Step 6: Stop.
a) Step 2
b) Step 3
c) Step 5
d) Step 4
Find the output for the following program 1 2 1 1 2.5.2
4
#include <stdio.h>
void main() {
inti=-1;
printf("i = %d\n", i--);
a) 1
Reg.No
SRM Institute of Science and Technology
Faculty of Engineering and Technology
b) -1
c) 0
d) 2
Identify the operator type that is used to compare two values 1 2 1 1 2.5.2
5 a) Unary
b) Relational
c) Assignment
d) Equal
6 2 2 1 1 2.5.2
The continue statement cannot be used with
a) for
b) while
c) do while
d) switch
2 2 1 1 2.5.2
7 Which of the following is an invalid if-else statement?
a) if (if (a == 1)){}
b) if (a){}
c) if ((char) a){}
d) if (func1 (a)){}
8 2 2 2 1 2.5.2
Do-while loop terminates when conditional expression returns?
a) One
b) Zero
c) Non - zero
d) None of the above
9. What will be the output of the following C code? 2 2 2 1 2.5.2
#include <stdio.h>
void main()
{
int k = 0;
for (k)
printf("Hello");
}
a) Compile time error
b) hello
c) Nothing
d) Varies
10 What is the return type of malloc() or calloc() 2 2 2 1 2.5.2
a) void *
b) Pointer of allocated memory type
c) void **
d) int *
Reg.No
SRM Institute of Science and Technology
Faculty of Engineering and Technology
Part B (4*5Marks=20 Marks)
Answer all questions
Sl.No Question CO PO BL Marks PI
Code
11 List out the rules to be followed in forming in identifier? 1 2 3 5 2.6.3
12 Define ternary operator with suitable example 1 2 3 5 2.6.3
13 Write the syntax for all the three iterative control statements. 1 2 2 5 2.6.3
14 Write the features of arrays 1 2 3 5 2.6.4
Part C( 2*10=20 Marks)
Answer all questions
Sl.No Question CO PO BL Marks PI
Code
15 a. What is c tokens? explain each and every elements of c tokens 1 2 3 10 2.6.3
(OR)
15 b. Briefly about the unconditional looping statements in c with 1 2 3 10 2.6.3
suitable example
16 a. Illustrate two-dimensional arrays with example. 2 2 2 10 2.6.3
(OR)
16 b. Write a C program to count the number of digits in a given 2 2 2 10 2.6.3
number.