DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
ASSIGNMENT - I QUESTIONS
Sub Code CS3251 Subject Name: PROGRAMMING IN C
Date of
Date of
Assignmen 24.03.25 4.04.25 Semester – II CSE - A
submission
t
PART –B
Answer all Questions
Q. Questions CO
Unit Area BT Level Complexity
No Mapping
Evaluate the following expressions using
operator precedence rule.
Explain the order of execution of operators. Basics of C
1. I Programmin CO1 Evaluate High
(8*3-4) + (5%5?3: -9) +5-20/10
g
a^ * b + (c / d) - 2 ^ 2 - (e + 4) where a = 2 b =
3c=8d=2e=5
2. Find the output of the following C code. I Basics of C CO2 Evaluate High
Discuss the steps of execution. Programmin
g
for(i=1,j=1; i<=10; ++i, ++j)
{
if (i== 3)
{
continue;
}
else
{
if (j== 4)
{
break;
}
else
{
printf(" I am in loop, the values of I and
J
are: %d, %d", i,j);
}
}
}
3. Write a menu-driven C program that simulates
a calculator with options to:
1. Add two numbers
2. Subtract two numbers Basics of C
3. Multiply two numbers I Programmin CO2 Create High
4. Divide two numbers g
5. Exit
The program should loop until the user
chooses to exit
4. Write a program to: II Arrays and CO3 Create High
Accept marks of 5 students in 3 subjects Strings
(use a 2D array)
Calculate total and average marks for each
student
Assign grades based on average:
A: ≥90, B: 75–89, C: 60–74, D: 50–59, F: <50
5. Write a C program to: II Arrays and CO3 Create High
Take n elements from the user Strings
Sort the array using selection sort
Search for a specific element using binary
search
Print whether the element is found and its
position
COURSE OUTCOMES:
At the end of this course, the students will be able to:
CO1 Demonstrate knowledge on C Programming constructs
CO2 Develop simple applications in C using basic constructs
FACULTY IN-CHARGE HOD