0% found this document useful (0 votes)
27 views31 pages

Question Bank PPS

Uploaded by

pun28003shweta
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)
27 views31 pages

Question Bank PPS

Uploaded by

pun28003shweta
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
You are on page 1/ 31

Unit - I

Introduction to Problem Solving and Programming Concepts

SR. No. Question BTL

1. What major advancement occurred during the second BTL1


generation of computers?

BTL2
2. Explain the difference between primary and secondary
memory

BTL3
3. Construct an algorithm and pseudocode to swap two
values without using a third variable.

BTL3
4. Develop flowchart to determine if the user entered
number is an Armstrong number or not.

5. Explain the key characteristics of the each generation of BTL2


computers

6. Explain the difference between primary and secondary BTL2


memory

7. What is the role of the CPU in a computer's BTL1


architecture?
8. Compare between system software and application BTL2
software?

BTL3
9. Construct an algorithm and pseudocode to swap two
values without using a third variable.

BTL3
10. Develop flowchart to determine if the user entered
number is an Armstrong number or not.

BTL3
11. Develop flowchart to find number is even or odd.

BTL3
12. Develop algorithm and pseudocode to calculate area
and perimeter of rectangle.

13. What are the steps present in the problem-solving BTL1


process?

14. Explain the steps in problem solving with a computer. BTL2

15. Compare between Top Down approach and Bottom Up BTL2


approach.

16. Explain key features of algorithms? BTL1

17. What is an algorithm and explain characteristics of an BTL1


algorithm.
18. Illustrate how repetition can be implemented in BTL2
algorithms along with example.

19. Explain Flowchart with uses of various symbols. BTL2

20. Construct an algorithm to swap two values. BTL3

21. List down steps of an algorithm to calculate the sum of BTL4


the first N natural numbers?

22. Develop flowchart to find number is even or odd. BTL3

23. Develop flowchart to calculate average of the first N BTL3


natural numbers.

24. Construct an algorithm to calculate the factorial of a BTL3


number.

25. Develop flowchart to calculate the factorial of a BTL3


number.

26. Explain the term pseudocode along with example. BTL2

27. Develop a pseudocode to determine if a number is even BTL3


or odd.
28. Compare Machine Level Language and High Level BTL2
Language.

29. Explain the generation of programming languages. BTL2

30. Distinguish between syntax errors and runtime errors BTL4


with examples.

31. What are the steps involved in executing a program? BTL1

32. What is a logic error, and why is it often difficult to BTL1


detect?

33. Explain what preprocessor directives are and provide an BTL2


example

34. Write a simple C program that prints "Hello, World!". BTL3

35. What are the main components of a C program? BTL1

36. Illustrate “What happens during the compiling BTL2


process”?

37. What is a decision in the context of algorithms? Provide BTL1


an example

38. Develop pseudocode to check number is Even or Odd. BTL3


39. Construct flowchart to display first ten numbers. BTL3

40. Construct algorithm to check number is Even or Odd. BTL3

41. Develop algorithm to calculate area and perimeter of BTL3


rectangle.

42. Develop flowchart for calculating area and BTL3


circumference of circle.

43. Construct algorithm for calculating average of first 10 BTL3


numbers.

44. Develop pseudocode for calculating area and perimeter BTL3


of rectangle.

45. Construct pseudocode to calculate average of first 10 BTL3


numbers.

46. Develop flowchart for calculating average of first 10 BTL3


numbers.

47. Develop an algorithm to find area and circumference of BTL3


circle.

48. Explain the significance of assembler, interpreter and BTL2


compiler.
49. Develop algorithm to calculate simple interest and BTL3
compound interest.

50. Construct flowchart to calculate simple interest and BTL3


compound interest.

51. Develop pseudocode to calculate simple interest and BTL3


compound interest.

52. Distinguish between algorithm and pseudocode. BTL4


UNIT-II : Programming Basics and Control Structures

Q. No. Questions BTL

List all conditional control statements used in C. Explain any BTL4


1. two with syntax and example.

Construct a C program that reads from the user an arithmetic BTL3


operator and two operands, perform the corresponding
2. arithmetic operation on the operands using switch statement.

Construct a C program to find the reverse of an integer BTL3


3. number and check whether it is palindrome or not.

What are unconditional control statements? Explain any two BTL2


4. with syntax and example.

5. Construct a C program to find the biggest of three numbers. BTL3

6. Explain switch statement with syntax and example. BTL2

List the differences between while loop and do-while loop. BTL1
Construct a C program to find the sum of Natural numbers
7. from 1 to N using a for loop.

Construct a C program to find the factorial of a number using BTL3


8. do-while ,where the number n is entered by the user.

What are two way selection statements? Explain if, if else, and BTL1
9. cascaded if-else with examples.
10. Explain with syntax the different loops used in C program. BTL2

Explain with syntax different types of loops used in C BTL1


11. programming.

Develop a program in C to find the sum of n natural numbers. BTL3


12.

13. Develop a C program to find GCD of two numbers. BTL3

14. Explain switch statement with syntax and example. BTL2

15. Develop a C program to find the biggest of three numbers BTL3

Develop a C program to determine if the user entered number is a BTL3


16. prime number or not.

What are looping statements in C programming? Explain any BTL2


17. two with syntax and examples.

Distinguish between break and continue statements with an BTL4


18. example

Develop a calculator program in C language to do simple BTL4


operations like addition, subtraction, multiplication and
19. division. Use switch statement in your program.

Develop a program to check whether the person is eligible to BTL4


20. vote.
Construct a program to check whether the person is eligible to BTL3
21. vote.

22. Explain syntax of for loop. BTL2

23. Distinguish between while and do-while statements. BTL4

Construct a program to print the multiplication table from 1 to BTL3


24. n?

25. Compare break and continue statement with an example. BTL2

26. Define goto with an example. BTL1

27. Define exit and return statements. BTL1

28. Explain various branching statements in C with examples. BTL2

29. Explain about the switch statement. BTL2

30. Construct a Program to perform arithmetic operations using BTL3


switch case.

31. List and explain loop control (or) iteration statements in C. BTL2

32. Explain syntax of do while loop. BTL2


33. Construct a program to generate prime numbers between 1 and BTL3
n

34. Construct a program to check whether the given number is BTL3


palindrome or not.

35. Construct a program to check whether the given number is BTL3


Even or Odd

36. List and explain unconditional statements in C with examples. BTL2

37. Construct a program to find the sum of the individual digits of BTL3
a given number.

38. Construct a program to find the sum of even and odd numbers BTL3
from 1 to n.

39. Construct a program to find the factorial of a given number. BTL3

40. Construct a program to generate ‗n‘ Fibonacci numbers. BTL3

41. What is a nested loop? Construct a program to display BTL3


multiplications tables from 1 to n.

42. Construct a program to display the following pattern. BTL3

*****
****
***
**
*
43. Distinguish between for loop and while loop BTL4

44. Distinguish between break and continue statements with an BTL4


example
Unit - III

Array and Strings

SR. No. Question BTL

1. What is an array? How is it different from a variable? BTL1

2. Explain the syntax for declaring a one-dimensional BTL2


array in C.

3. How do you declare a two-dimensional array? Provide BTL1


an example.

4. What is the significance of specifying the size of an BTL1


array during declaration?

5. How do you access the first element of a one- BTL1


dimensional array?

6. What happens if you try to access an element outside BTL1


the bounds of an array?

7. How can you loop through all elements of a one- BTL1


dimensional array? Provide example.
8. Explain how to access elements in a two-dimensional BTL2
array using indices.

9. Construct a program that finds the maximum element in BTL3


a one-dimensional array.

10. How can you reverse the elements of a one-dimensional BTL1


array in place?

11. What is a two-dimensional array? Give an example. BTL1

12. How do you initialize a two-dimensional array with BTL1


specific values?

13. What is a string in programming? How is it different BTL1


from a character array?

14. How do you declare and initialize a string in C? BTL1

15. What are some common ways to read a string from user BTL1
input?

16. How does the strlen() function work? Provide an BTL1


example.

17. Develop a program that uses strcat() to concatenate two BTL3


strings.
18. Explain the syntax for declaring a one-dimensional BTL1
array in C.

19. Develop a program to count the number of vowels in a BTL3


given string using arrays.

20. Develop a program that reverse the elements of a one- BTL3


dimensional array.

21. What is an array? How is it different from a BTL1


variable?Explain with an example.

22. Construct a program that finds the largest element in a BTL3


one-dimensional array.

23. Develop a program that uses strcat() to concatenate two BTL3


strings.

24. Explain with a suitable example, how to access BTL1


elements in a two-dimensional array using indices.

25. Distinguish between one-dimensional array and two- BTL3


dimensional array with a suitable example.

26. Construct a program that finds the smallest element in a BTL3


one-dimensional array.
27. Explain the purpose of the strcmp() function and how it BTL2
is used.

28. How can you use arrays and strings together to check if BTL1
a string is a palindrome?

29. Construct a program to count the number of vowels in a BTL3


given string using arrays.

30. How can you sort an array of strings in alphabetical BTL1


order? Provide a code example.

31. What are the differences between static and dynamic BTL1
arrays?

32. Construct a program that removes duplicates from a BTL3


one-dimensional array.

33. How can you sort an array of strings in alphabetical BTL1


order? Provide a code example.

34. Distinguish between one-dimensional array and two- BTL4


dimensional array with suitable example.
Unit - IV

Functions and Pointers

SR. No. Question BTL

1. Define Function, along with need of function. BTL1

2. Why are functions important in programming? BTL1

3. Explain function with its syntax. BTL2

4. Explain different methods of passing values to BTL2


functions? Explain each with examples.

5. Explain the scope of a variable in a function? Explain BTL2


local and global scope.

6. What is meant by the order of passing arguments in a BTL1


function call?

7. List different parameter passing ways and Describe how BTL4


functions handle default arguments.
8. What is a return type in a function? Why is it BTL1
important?

9. What is the purpose of the return statement in C? Write BTL1


a simple program to demonstrate its use.

10. Distinguish between call by reference and call by value BTL3


with suitable example.

11. Build a function is_leap_year which takes the year as its BTL3
argument, checks whether the year is a leap year or not,
and then displays appropriate message on the screen.

Define pointers, explain the difference between a null


12. pointer and a void pointer. BTL1

Develop a program to calculate the factorial of a number


13. using the user defined function “fact”. BTL3

Analyze how a program behaves when the number of


14. actual parameters is less than the formal parameters in a BTL3
function. Identify possible errors or outcomes, explain
with an example.

15. Why are functions needed in C? Explain the concept of BTL3


a function, its syntax, and provide a suitable example.

16. Distinguish between Library functions and User defined BTL1


functions in C programming and explain with
examples.
17. Build a program that uses functions to calculate the BTL3
area and circumference of a circle. The radius should be
passed as a parameter.

18. Explain recursion with a suitable example. BTL2

19. What is a pointer variable? Explain its significance in BTL1


programming.

20. How do you declare and initialize a pointer variable? BTL1


Provide an example.

21. What happens if you use an uninitialized pointer? BTL1

22. Illustrate with example of a function that demonstrates BTL2


call by reference using pointers.

23. Explain how to use functions like malloc, calloc, and BTL2
free in C for dynamic memory management.

24. Develop program using function that takes two integers BTL3
as parameters and returns their sum.

25. Construct program that uses functions to calculate the BTL3


area and circumference of a circle. The radius should be
passed as a parameter.
26. Develop a function that swaps two numbers using both BTL3
pass-by-value and pass-by-reference techniques.

27. What are library functions? Provide examples of BTL1


commonly used library functions in a programming
language.

28. Construct C program that uses a library function to find BTL3


the square root of a number and then prints the result.

29. Develop C program for recursive function to calculate BTL3


the factorial of a number.

30. What are pointer expressions? How can they be used in BTL1
arithmetic operations?

31. Distinguish between passing by value differs from BTL4


passing by reference to function.

32. Illustrate Dynamic memory allocation with suitable BTL2


example.

33. What is the purpose of main function? BTL1

34. Develop C program to calculate the average of first n BTL3


numbers using function.
35. What are advantages and disadvantages of call by BTL1
reference technique?

36. Explain Null pointers with suitable example. BTL2

37. Compare * and &. BTL2

38. Compare between array and pointers. BTL2

39. Distinguish between Library functions and User defined BTL4


functions in C and Explain with Examples.

40. Compare actual parameters and formal parameters. BTL2

41. Explain in detail about nesting of functions with BTL2


example.

42. Explain about various arithmetic operations that can be BTL2


performed on pointers.

43. Explain pre-processor in C. BTL2

44. Develop C program to check year is leap year or not BTL3


using function.

45. Construct C program for calculating factorial of number BTL3


using function.
46. Explain scope of a variable using suitable example. BTL2

47. Develop C program to calculate area and perimeter of BTL3


rectangle using function, pass length and breadth to
function and return the result.

48. Construct C program for calculating square of number BTL3


using library function and user defined function by
passing value of number.

49. Compare function declaration and function definition BTL2


using suitable example.
UNIT- V : Structures and Unions

Q. No. Questions BTL

1. Compare arrays and structures. BTL2

2. Compare structures and unions. BTL2

3. Define Structure in C. BTL1

4. What do you mean by structure definition? BTL1

5. How to Declare a Member in Structure? BTL1

6. What is meant by Union in C? BTL1

7. How to define a union in C. BTL1

8. What are storage classes? BTL1

9. What are the storage classes available in C? BTL1

10. What is register storage in storage class? BTL1

11. What is static storage class? BTL1

12. Define Auto storage class in C. BTL1


13. Define Macro in C. BTL1

14. Define Union in C , Explain how members of a union are BTL1


accessed using a program code?

Develop a structure named "Car" to store details like car ID, BTL3
15. model, and cost. Write a C program to input data for three cars,
and display the information.

16. Distinguish between a structure and an array with suitable BTL4


example.
Explain the concept of nested structures with an example.
17. BTL1

Develop a structure named Book to store book details like title,


author, and price. Write a C program to input details for three BTL3
18. books, find the most expensive and the lowest priced books, and
display their information.
Distinguish between structure and union, Explain in which
19. applications union can be useful? BTL4

What do you mean by structure definition? Define BTL3


Structure “Employee” to store Employee name,
20. Designation, Date of Joining, Salary.

Develop a C program to define a structure to store the BTL4


information of 5 students, including their name, roll
number, and marks. Use an array of structures and print
21. the details of all students

22. Distinguish between structure and union with suitable example. BTL1

23. What is Line control? Line control (#line) BTL1


24. What is the use of ‘typedef’’? BTL1

25. Construct the syntax for pointers to structure. BTL2

26. Define self referential data structure BTL1

27. Define Structure? How to Initialize a Structure? BTL1

28. How to represent self-referential structures? BTL1

29. Define Union? How to represent a union? BTL1

Construct some of the differences between Structure and BTL3


30. Union?

What are the Different ways of representing Structures BTL1


31. and Functions?

What is a structure? Create a structure with data members BTL1


32. of various types

What is a structure? Create a structure with data members BTL1


33. of various types and declare two structure variables.

Construct a program to read data into these and print the BTL3
34. same. Justify the need for structured data type.
Construct a C program to store the employee information BTL3
using structure and search a particular employee using
35. Employee number.

Define and declare a nested structure to store date, which BTL1


36. includes day, month and year.

Explain about an array of structures and pointers in BTL2


37. structures with an example program.

Construct a C program to create a mark sheet for students BTL3


38. using a self referential structure.

Define a structure named Time with members hours, BTL3


minutes, and seconds. Construct a C program to input two
times, add them, and display the result in proper time
39. format.

Construct a C program to read name and marks of n BTL3


40. number of students from user and store them in a file.

41. Create a structure named Book to store book details like BTL3
title, author, and price. Construct a C program to input
details for three books, find the most expensive and the
lowest priced books, and display their information.

42. Define a structure named Circle to represent a circle with BTL3


a radius. Write a C program to calculate the area and
perimeter of two circles and display the results.
43. Define a structure named "Date" with members day, BTL3
month, and year. Write a C program to input two dates
and find the difference in days between them.

44. Design a structure named "Car" to store details like car ID, BTL3
model, and rental rate per day. Write a C program to input
data for three cars, calculate the total rental cost for a
specified number of days, and display the results.
Unit - VI

File Operations

SR. No. Question BTL

1. What is the purpose of opening a file in programming? BTL1

2. Explain the syntax for opening a file in C. What BTL2


parameters does it require?

3. What are the different modes for opening a file, and BTL1
what does each mode signify?

4. How do you read data from a file using standard library BTL1
functions? Provide an example.

5. What function would you use to read an entire line from BTL1
a file in C?

Explain the difference between fgets( ) and gets( ) with


6. suitable example. BTL1

Develop a program to read and display the contents of a BTL3


7. text file.
Develop a program to count characters, tabs and spaces BTL3
8. in a text file

Explain the purpose of each mode used for opening a BTL1


9. file?

Compare different standard library functions for reading BTL3


10. data from a file with suitable example.

Build a C program to append the contents of “try1.txt” at BTL4


11. the end of another file “try2.txt”.

BTL1
12. Explain the syntax for opening a file in C with a
suitable example. What parameters does it require?

BTL3
13. Develop a program that counts the number of characters
in a file.

BTL4
14. Distinguish between reading characters and reading
strings from a file.

15. Distinguish between reading characters and reading BTL4


strings from a file.

16. What are some common reasons for failure when BTL1
attempting to open a file?

17. How can you handle errors when a file fails to open? BTL1
Provide a code snippet demonstrating this.
18. What is the importance of checking if a file opened BTL1
successfully?

19. Why is it important to close a file after operations are BTL1


complete?

20. What function is used to close a file in C? What does it BTL1


return?

21. Develop a program that counts the number of characters BTL3


in a file.

22. How can you modify a program to count tabs and BTL1
spaces in a file?

23. What methods can be used to count specific characters BTL1


in a file? Provide a code example.

24. Explain how to write a simple file copy program in C. BTL2

25. What considerations should be made when copying BTL1


large files?

26. Explain the differences between text and binary file BTL2
opening modes.

27. What is the effect of opening a file in "append" mode BTL1


versus "write" mode?
28. How do you open a file in read/write mode in C? BTL1
Provide an example.

29. How do you write a string to a file? Give a code BTL1


example.

30. Illustrate how you can read a file line by line using BTL3
functions like fgets().

31. What challenges do newlines present when reading BTL1


from or writing to files?

32. How can you handle newline characters properly when BTL1
processing file input?

33. What are the main differences between text files and BTL1
binary files?

34. When would you choose to use a binary file over a text BTL1
file?

35. Explain some real-life applications where file handling BTL2


is essential.

36. How is file handling used in data processing or data BTL1


analysis? Provide examples.
37. Explain how configuration files are handled in BTL2
applications. Why are they important?

38. What is the significance of the EOF (End of File) BTL1


marker in file handling?

39. How can you seek to a specific position in a file using BTL1
file handling functions? Provide an example.

You might also like