INTRODUCTION_TO_C_PROGRAMMING_ Question Bank_Unit1_to_3_&_Lab_Program_List
INTRODUCTION_TO_C_PROGRAMMING_ Question Bank_Unit1_to_3_&_Lab_Program_List
Unit 1
1. Briefly describe the four fundamental data types that ‘C’ supports.
2. List and explain types of operators in in C.
3. Explain binary operators in C.
4. Discuss Conditional operator in C with example.
5. List and explain types of logical operator with example.
6. List and explain types of relational operator with example
7. Explain Bitwise operators with example.
8. Illustrate Right shift and Left Shift operator with example.
9. Differentiate pre Increment and post increment operator.
10. Explain type conversion in C.
11. Describe the significance of operator precedence and associativity in determining
the correct evaluation of arithmetic expressions. Explain with an example.
12. Evaluate the following expressions step by step by considering the operator
precedence and associativity :
a. 7 * (5 + 15) / (2 * 5) – 3
b. (10 + 5) * 2 - 20 / (4 % 3)
c. -7*5/(3+2*3/12+8)+15*( 10 / 5)
d. a-b/3+c*2-1 where a = 9, b =12, and c=3
e. 6*2/(2+1*2/3 +6)+8*(8/4)
13. Explain the syntax of simple if, if else with syntax, flowchart and example.
14. Explain the syntax of switch and else-if ladder with syntax, flowchart and example..
15. Explain break, continue and goto statement with example and their use.
16. Write a program to find greatest number among three numbers using nested if else.
17. What are loop control structures? Explain While, do-while and for loops with syntax
and flow Diagram.
18. Develop a C program to simulate the use of Simple calculator using switch.
19. Differentiate between entry-controlled loop and exit controlled loop.
20. Write a C program to check if a number is even or odd.
21. Write a C program to calculate sum of n natural numbers.
Unit 2
1. With example explain different ways to initialize 1-dimensional arrays in C.
2. Design a C program to sort n integer elements in ascending order.
3. Illustrate with example to declare and initialize 2-D array in C.
4. Design a C program to find smallest and largest element in a given 3x3 matrix of
integer elements.
5. What do you mean by string? How string is represented in C.
6. Explain how character arrays/strings are declared and initialized in C with an
example.
7. Explain any five string manipulation functions with their syntax and give example for
each.
8. Write a C program to perform the following tasks using built-in string functions:
a. Reverse a given string.
b. Determine the length of the given string.
9. Define Functions? Discuss the advantages of using Function in any
application/program.
10. Compare and Contrast User defined Functions and Predefined functions.
11. Differentiate between User defined functions and Library Functions.
12. Determine the various elements of User defined functions with an example.
13. llustrate the different categories of functions with an example.
14. Explain the different types of Function Call.
15. Compare and contrast Call by Value and Call by Reference.
16. Using the concept of functions, Write a C Program for the following
a. To sort the given array elements using bubble sort technique
b. To sort the given array elements using selection sort technique
c. To search a given key element using Linear Search Technique.
Unit 3
1. What is a Structure? Explain the syntax of a structure with an example.
2. Which are the 2 ways in which structure variables can be created? Explain with
examples.
3. Explain the significance of dot operator in accessing structure members.
4. How can you copy one structure to another? Explain.
5. Explain how you can compare 2 structure variables.
6. Create a structure called Employee with the fields: Name,Branch and Experience and
input the details of 2 employees.
7. Create a structure with the name Student which has the following fields: USN, Name,
and Branch. Input the details of 10 students.
8. Define a pointer. List out the benefits of using pointers in C
9. Explain how pointers are declared and initialised with general syntax and example
10. Considering an example write the difference between & operator and * operator.
11. Write a program to add two numbers using pointers
12. Write a C program to read N integers into an array A and find the sum of elements
using pointers
13. Write a C program using pointers to perform the following:
a. display the address of a variable
b. display the value stored at the address
14. Define a file. List and explain the functions used in C to perform basic file operations
15. Develop a C program that reads user input from the console, stores the input in a
file, and then reads and displays the stored content on the terminal.
16. Explain the various file operations with general syntax and an example.
17. Write the general syntax of fopen function and explain the different file Opening
modes
18. Write the syntax and explain the following: fopen() and fclose().
19. Write a C program to perform input and output operation on file using getc() and
putc().
20. Write a C program to copy contents of one file to another file.
21. Write a C program to perform reading and writing from file using fprintf() and
fscanf().
Introduction to C Programming - Lab Programs