SNS COLLEGE OF TECHNOLOGY
(An Autonomous Institution)
Approved by AICTE, New Delhi, Affiliated to Anna University, Chennai
Accredited by NAAC-UGC with ‘A++’ Grade (Cycle III) &
Accredited by NBA (B.E - CSE, EEE, ECE, Mech&B.Tech.IT)
COIMBATORE-641 035, TAMIL NADU
Academic Year 2024-2025 (ODD Semester)
First Semester
23CST101 – PROBLEM SOLVING AND C PROGRAMMING
Question bank
PART A
1. What is the role of strcpy() function?
2. What is the size of a double data type in C on a typical system?
3. What is the difference between float and double data types in C?
4. Write a for loop to print from 10 to 1.
5. Identify the format specifier used in code and write its output.
6. What is the function used to find the length of a string in C?
7. Differentiate between break and continue with an example.
8. What is an array and types of arrays?
9. What will the following code output?
int arr[] = {10, 20, 30};
printf("%d", arr[1]);
10. What is the difference between a one-dimensional and a two-dimensional array in C?
11. How do you declare and initialize a string in C?
12. Classify the control statements.
13. How do you declare an array of 5 integers in C?
14. What is the default value of an uninitialized int variable in C?
15. What is the purpose of the %lf format specifier in scanf() and printf() functions in C?
16. What is the role of the increment operator as a suffix? (Apply a program to show the effect.)
17. What is the syntax of nested if-else statements?
18. How do you initialize a 2D array in C?
19. What is the difference between break and continue in loops?
20. Illustrate the rules for logical operators with an example.
21. Write a program to show the effect of increment operator as a suffix.
22. Apply a program to show the effect of increment operator as a suffix.
23. What will the following code output and justify your answer?
int arr[] = {10, 20, 30};
printf("%d", arr[1]);
PART – B
1) Write a program to display the following pattern:
*
**
***
2) Explain the formatted functions and unformatted functions with examples.
3) Write a C program involving iterations to do 2D matrix multiplication of size 2X2.
4) Write a C program involving iterations to do 2D matrix addition of size 2X2.
5) Explain the String Standard functions with suitable syntax.
6) Develop a program in C that searches for a target element in an array of N elements. Return the
position of the target element or indicate its absence.
7) Explain the For loops and nested for loops with example.
8) Write a C program involving iterations to do 2D matrix subtraction of size 2X2.
9) Illustrate with examples of character I/O functions.
10) Explain the different types of Arrays with suitable program.
11) Develop a C program for a string, str1[20] = "???", str2 = "????", and perform the following
string handling functions(all 7 operations)
12) In many applications, organizing data is crucial for efficient operations such as searching and
analysis. The task is to sort an array of integers in ascending order using a simple and reliable
approach in the C programming language. Write a C program to Search an element in an array.
13) List out the difference between while and do-while loop with suitable examples.
14) How to create a data type in C and explain their types in detail with an example?
15) Explain the program to print lines by selecting the choice.
16) Explain the datatypes and the corresponding format specifiers with suitable examples
17) Explain the different types of operators with suitable examples