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

Question Bank C Programming

The document is a question bank for a B.Tech course in Programming with C for Problem Solving, covering various topics across five units. It includes short answer and long answer type questions that assess students' understanding of programming concepts, data types, control structures, pointers, memory allocation, and file handling in C. The questions are categorized by Bloom's Taxonomy levels and aim to evaluate both theoretical knowledge and practical programming skills.

Uploaded by

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

Question Bank C Programming

The document is a question bank for a B.Tech course in Programming with C for Problem Solving, covering various topics across five units. It includes short answer and long answer type questions that assess students' understanding of programming concepts, data types, control structures, pointers, memory allocation, and file handling in C. The questions are categorized by Bloom's Taxonomy levels and aim to evaluate both theoretical knowledge and practical programming skills.

Uploaded by

Prince Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Question Bank

Course & Branch : B.tech(CSE/AIML) Semester: II

Subject : Programming with c for problem solving Subject Code: EE105203/EE106223

No. of Students: - Regular/ Reappear: Regular

Short Answer Type Questions

Level in BT Iden
Sr. Question
tify Question
No Type
CO
K1 1 Unit -1 What are high-level programming languages?
1.​
K1 1 Unit -1 What is the purpose of a flowchart in programming?
2.​
K2 1 Unit -1 What is computer-based problem solving?
3.​
K2 1 Unit -1 What is top-down design in program development?
4.​
K4 1 Unit -1 Compare the use of if-else statements and switch statements in C. When
5.​
would you use one over the other?
K1 2 Unit -2 What are the different data types used in C?
6.​
K1 2 Unit -2 How does the for loop function in C programs?
7.​
K2 2 Unit -2 What are operators and expressions in C programming?
8.​
K2 2 Unit -2 What is the syntax and usage of the while loop in C?
9.​
K3 2 Unit -2 Write a C program to initialize a one-dimensional array with 5 elements
10.​
and print them.
K1 3 Unit-3 What is the purpose and syntax of the switch statement in C?
11.​
K1 3 Unit-3 What does the exit() function do in a C program?
12.​
K2 3
Unit-3 How does the do-while loop work in C?
13.​

K2 3 Unit-3 How is the goto statement used along with labels in C?


14.​
K6 3 Create a C program that demonstrates the use of call by reference to
15.​ Unit-3
swap the values of two variables.
K1 4 Unit-4 How do you initialise a pointer in C?
16.​

K1 4 Unit-4 How is pointer arithmetic performed in C?


17.​

K2 4 Unit-4 What is the use of the & and * operators in pointer operations in C?
18.​

K2 4 What is the difference between malloc() and calloc() in dynamic


Unit-4
19.​ memory allocation?

K3 4 Unit-4 Write a C program to demonstrate the use of a pointer to access and


20.​
modify an array's elements.
K3 4 Unit-4 Write a C program to dynamically allocate memory for an array of
21.​
integers using malloc().
K1 5 Unit-5 What is the use of the fprintf() function in C?
22.​

K1 5 Unit-5 How is the #include directive used in C programs


23.​

K2 5 Unit-5 How is the fopen() function used to open a file in C?


24.​

K2 Unit-5 What is the purpose of the fclose() function in C?


25.​

Long Answer Type Questions


Level in BT
Sr. Questio
Identify Question
No n Type
CO
K1 1 Unit -1 What is an interpreter in programming explain in detail ?
1.​

K1 1 Explain how flowcharts are used in programming to represent logic


Unit -1
2.​ and processes. Provide an example of a simple flowchart for a
program.​
K2 1 Compare and contrast the roles of assemblers, compilers, and
Unit -1
3.​ interpreters in the translation process of a program. How do they
affect the efficiency of program execution?​
K2 1 Unit -1 Propose a scenario in which an interpreter would be more
4.​
beneficial than a compiler. Justify your choice with specific examples
K3 1 Write a C program that takes two integers as input from the user
Unit -1 and outputs their sum, difference, product, and quotient. Explain
5.​
the steps involved in writing this program.

K1 2 Unit -2 How do you declare a multidimensional array in C?


6.​

K1 2 Describe the different data types available in C. Differentiate


Unit -2 between primary (basic), derived, and user-​​ defined data
7.​
types

K2 2 What are operators in C? Explain different types of operators such


as arithmetic, relational, logical, bitwise, assignment, conditional
Unit -2
8.​ (?:), and special operators like & and *. Illustrate each with code
examples

K2 2 Discuss the various types of operators in C, including arithmetic,


relational, logical, assignment, and bitwise operators. Write a C
Unit -2 program that demonstrates the use of different operators within a
9.​
single expression and explain the order of precedence and
associativity.

K3 2 Compare and contrast different control structures in C: if-else,


Unit -2 switch, for, while, and do-while loops. Write examples to illustrate
10.​
their syntax and appropriate usage scenarios.

K2 3 Unit-3 What is the function of continue in loops?


11.​

K3 3 Write a C program that accepts a menu choice from the user using a
switch statement. Implement options using loops and control flow:
Unit-3 e.g., calculate factorial (with do-while), check for prime number
12.​
(while), and use break to exit the menu. Use goto to return to the
menu after each option

K3 3 Define and explain the use of the following control constructs in C:


Unit-3 do-while loop, switch statement, break, continue, exit() function,
13.​
and goto with labels. Provide syntax and brief examples for each.

K4 3 Define and explain the use of the following control constructs in C:


Unit-3 do-while loop, switch statement, break, continue, exit() function,
14.​
and goto with labels. Provide syntax and brief examples for each.
K4 3 Differentiate between break, continue, and exit() in terms of
15.​ program control flow. In what situations would each be used
Unit-3
appropriately? Write a program using a switch statement and
demonstrate the use of break and exit() within it.

K1 4 Unit-4 What is a union in C and how is it declared?


16.​

K2 4 Unit-4 Describe the purpose and use of the malloc(), calloc(), realloc(), and
17.​
free() functions in C. How do these functions differ from each other?
K3 4 What is a pointer to a function? How can functions be called
through function pointers? Write a program that uses an array of
Unit-4
18.​ function pointers to implement a simple calculator supporting add,
subtract, multiply, and divide operations.

K4 4 Define a union and explain how it differs from a structure in terms


of memory usage and application. Provide a program to
Unit-4
19.​ demonstrate how a union works and explain what happens to
memory when multiple members are used.

K5 4 Write a C program that dynamically allocates memory for an array


Unit-4 of integers using malloc(), initializes the array with values, and then
20.​
prints these values. Ensure that you properly free the allocated
memory at the end of the program.
K1 5 Unit-5 What are header files and why are they important in C?
21.​

K2 5 Write a program to open a file in write mode using fopen(), write


Unit-5 user-input text into the file using fprintf(), then close the file using
22.​
fclose(). Afterward, reopen the file in read mode and use getc() to
read and display the content of the file.
K3 5 Explain how the #define and #include directives work in the C
preprocessor. Provide examples demonstrating how #define is used
Unit-5 for constants and macros, and how #include is used to include
23.​
standard and user-defined header files.​ ​ ​ ​
​ ​ ​ ​ ​ ​ ​ ​ ​
​ ​
K4 5 Explain the concept of file handling in C. List and define the
different file accessing functions such as fopen(), fclose(), getc(),
Unit-5
24.​ putc(), and fprintf(). Discuss the role of the file pointer in file
operations.
K5 5 Evaluate the differences between structures and unions in C
Unit-5
25.​ programming. When would you choose to use a union instead of a
structure?

You might also like