Department of Computer Science & Engineering and AI&ML
Subject Code: 22ESCCS101 Max.Marks:100 Subject: Principles of Programming Using C Duration: 03 Hours st B.E. 1 Semester End Examination-2022-23 MODEL QUESTION PAPER Note: All questions are compulsory. Bloo
Marks m’s
CO’ Question Questions
Number Write the algorithm and flowchart to check a given number +ve , -ve or CO1 L2 1. a) 8 Zero and display the message accordingly. Explain the structure of C Program in detail. Write a sample program to L2 b) 6 demonstrate five components in the structure of C program. L2 c) Explain and demonstrate formatted output of integers in C. 6
L2 a) Demonstrate functioning of any two bitwise operators in C. 4
CO1 2. L2 b) Describe any three types of ‘if ’statements in C and draw their 6 flowcharts. Write a C Program to display the following pattern by reading the c) 6 number of rows as input. 1 L3 121 12321 1234321 n th row d) Predict output of following C program(No errors in the below code): 4 #include <stdio.h> int main() { L3 int i; for(i=65; i<(65+26);i++) printf("%c ",i); return 0; } List any four categories of user defined functions based on parameters L2 a) & return value .Write simple C programs to demonstrate each of these CO4 3. 10 function categories. CO2 L2 b) Write a C program to sort ‘n’ numbers using bubble sort algorithm. 10 Implement a user-defined function to simulate the built-in function L2 a) 10 CO2 4. strcat(). Write C program to demonstrate use of this function. Write a C program to reverse a number and check if it is a palindrome or L2 b) not without using built-in/library function. 5 Explain the concept of pointers in C. Demonstrate pointer declaration, CO3 c) 5 L2 initialization and accessing data through pointers.
CO3 Define a structure with members as a character array, a float and an
L2 5. a) integer. Show compile-time and runtime initialization of this structure’s 10 instance. Assuming a file named as “data.txt” has some text stored in it. CO4 L2 b) 10 Implement a C program to count the number of characters in the text.