0% found this document useful (0 votes)
44 views5 pages

SRM Institute of Science and Technology College of Engineering and Technology

Uploaded by

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

SRM Institute of Science and Technology College of Engineering and Technology

Uploaded by

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

Registration

Number

SRM Institute of Science and Technology


SET 1
College of Engineering and Technology
School of Computing
SRM Nagar, Kattankulathur – 603203, Chengalpattu District, Tamil Nadu
Academic Year: 2024-25 (ODD)

ANSWER KEY

Test: CT1 Date: 30-09-2024


Course Code & Title: 21CSS101J Programming for Problem Solving Duration: 1hr 40 mins
Year &Sem: I/I Max. Marks: 50

Course Articulation Matrix: (to be placed)

S.No Course PO PO2 PO3 PO4 PO5 PO6 PO PO PO9 PO1 PO11 PO12
Outcome 1 7 8 0
1 CO1 2 3 2
2 CO2 2 3 2
3 CO3 2 3 2
4 CO4 2 3 2
5 CO5 2 3 2

Course Outcomes (CO):

CO-1: Solve problems through computer programming. Express the basic data types and variables
in C
CO-2: Use appropriate data types in simple data processing applications. To create programs using
the concept of arrays.
Part A (10* 1 = 10 Marks)

Sl. Mark B C P PI
Question Code
No s L O O
1 (b)void main() 1 1 1 1 1.4.1

2 (b)32 1 1 1 1 1.3.1

3 (d)654.124 1 2 1 2 2.2.3

4 (b)Relational operator 1 2 1 2 2.2.4

5 (b)19 1 2 1 2 2.4.1

6 A) for 1 2 2 2 2.1.2

7 c) 4 1 2 2 2 2.4.2

8 a) 12 1 2 1 2 2.4.2

9 A) Hello Boss. 1 2 1 2 2.4.2


10 B) 15 10 1 2 1 2 2.4.2

Part-B (5 x 4= 20 Marks)
Answer all the questions

M
Sl. B PI
Question ar CO PO
No ks
L Code
With suitable examples discuss the concept of
variables in C.
11 4 2 1 1 1.4.1
● Variable definition (2)
● Example code (2 )
Devise an algorithm to read the age of two of your
friends and find the sum, product and difference of
their ages.
12 4 3 1 1 1.3.1
● Reading input (1)
● Processing the data (2)
● Display output (1)
Debug the code given below so as to generate the
desired output 1 2 4 5.
#include<stdio.h>
void main()
{
for(int i=1;i<5;i++) // <=
13 { 4 4 2 2 2.4.2
if(i==3)
{
break; // continue;
}
printf("%d\n",i);
}
}
14 Complete the program by filling in the missing 4 4 2 2 2.4.2
parts in some statements.
#include<stdio.h>
void main()
{
int m;
printf("Input m value");
scanf("%d", &m);
switch(m)
{
case 9:
printf("Autumn");
break;
case 6:
printf("Summer");
break;
case 5:
printf("Spring");
break;
case 1:
printf("Winter");
}
}
You are assigned to create a program for a school
that calculates the average marks of students in a
class.
● 5 variables to be declared one each
for marks, total, average, iteration 1,
15 and no_of_students (1) 4 3 2 2.1.3
2
● Looping statement to read
no_of_students marks and sum it up
and calculate average (2)
● Display the output(1)

Part C (2 * 10 = 20 Marks)

M
a
Sl. PI
Question r BL CO PO
No k
Code
s
Design an algorithm and implement the same
using C program for carrying out the following
tasks
● Read age, year of study, section,10 th
marks, 12th marks.
● Product of age and year of study

● Sum and Difference of 10th and 12th marks

● Double the age without using the


multiplication operator (Hint: use the shift 1
16 3 1 2 2.1.3
0
operator)

✔ Declare 2 integer (age and year of


study), 1 char (section) and 2 float
variables (5)
✔ Use +,-,* operators and display the
result (3)
✔ Use left shift (<< ) and display the result
(2)
(OR)
17 Write a C program that reads an integer from the 1 3 1 2 2.1.3
user and performs the arithmetic operations 0
sequentially. The program should output a single
final result.
1. Add 10 to the number.
2. Multiply the result by 2.
3. Subtract 5 from the result.
4. Divide the result by 3 (integer division).

✔ Declare and read input (2)

✔ Usage of assignment operators +=, *=, -


=, /= in the given order (6)
✔ Output the result of applying the
operations on the input (2)
Write a C program that checks two given
temperatures and returns true if one temperature is
less than 0 and the other is greater than 100,
otherwise, it returns false.
✔ Declare two floating point variables (2)

✔ Read input (1) 1


18 3 2 2 2.1.3
0
✔ Usage of relational operators <, > (2)

✔ Usage of if statement (2)

✔ Usage of logical operator (2)

✔ Display the result (1)

(OR)
Write a C program and an algorithm to help your
CR in determining the average age of your class.
Algorithm:
Read no-of students (1)
Read n student’s age (2)
Accumulate total (1)
Computer average(1)
display output(1)

Program 1
19 3 2 2 2.1.3
0
● 5 variables to be declared one each
for age, total, average, iteration and
no_of_students (1)
● Looping statement to read
no_of_students marks and sum it up
and calculate average (2)
● Display the output(1)
Course Outcome (CO) and Bloom’s level (BL) Coverage in Questions

You might also like