Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
40 views

Programming for Problem Solving

Imp

Uploaded by

sachinkush1917
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Programming for Problem Solving

Imp

Uploaded by

sachinkush1917
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

GTUSTUDY.

COM

Program Name: Engineering


Branch: ALL
Course / Subject Code: BE01000121
Course / Subject Name: Programming for Problem Solving

Chapter 1: Introduction to Programming


3-Mark Questions:
1. Define the basic components of a computer system (hardware and software).
2. List and describe the types of programming languages.
3. What are language translators, and differentiate between compilers and
interpreters?
4-Mark Questions:
1. Explain the concept of flowcharts in problem-solving. How are they useful in
programming?
2. Discuss the steps involved in writing an algorithm to solve a problem.
7-Mark Questions:
1. Create a flowchart and an algorithm for finding the largest of three numbers.
2. Compare the working of a compiler and an interpreter with examples.

Chapter 2: Basics of C Programming


3-Mark Questions:
1. Describe the basic structure of a C program.
2. What are the different data types in C? Explain primitive data types.
3. Define a variable and a constant in C programming.
4-Mark Questions:
1. Explain the syntax and semantics of a C program with an example.
2. List and explain the types of operators used in C programming.

VISIT :- https://gtustudy.com/ 1
GTUSTUDY.COM

7-Mark Questions:
1. Write a simple C program to demonstrate the use of different operators (arithmetic,
relational, logical).
2. Discuss the structure of a C program, explaining each part with an example.

Chapter 3: Control Structures


3-Mark Questions:
1. Explain the usage of the if and switch-case statements in C programming.
2. What is the difference between a for loop and a while loop in C?
3. How does the break statement work in a loop?
4-Mark Questions:
1. Write a C program using nested if-else statements to find the largest of three
numbers.
2. Explain the use of continue and break statements with an example.
7-Mark Questions:
1. Write a program using a switch-case statement to display the day of the week based
on user input.
2. Demonstrate the use of all three types of loops (for, while, do-while) in C with
examples.

Chapter 4: Functions and Modular Programming


3-Mark Questions:
1. What is a function in C? Explain the components of a function.
2. Define recursion in programming. Give an example of a recursive function.
3. List the standard library functions used in C programming.
4-Mark Questions:
1. Explain the different ways of passing parameters to a function in C (pass by value and
pass by reference).
2. Discuss the purpose and use of header files in C programming.
7-Mark Questions:
1. Write a C program to calculate the factorial of a number using recursion.

VISIT :- https://gtustudy.com/ 2
GTUSTUDY.COM

2. Create a function to swap two numbers using call-by-reference in C.

Chapter 5: Arrays and Strings


3-Mark Questions:
1. What is an array in C? Define one-dimensional and multi-dimensional arrays.
2. Write a program to find the largest element in a one-dimensional array.
3. Explain basic string operations in C (like string concatenation and comparison).
4-Mark Questions:
1. Write a C program to reverse a string using array-based string handling functions.
2. Discuss the difference between arrays and strings in C.
7-Mark Questions:
1. Write a C program to perform the matrix multiplication of two 3x3 matrices.
2. Write a program to find the length of a string without using string handling functions.

Chapter 6: Pointers
3-Mark Questions:
1. What is a pointer in C? How are pointers and arrays related?
2. Define pointer arithmetic in C.
3. Explain the use of pointers to functions in C.
4-Mark Questions:
1. Demonstrate pointer operations in C with examples.
2. Write a program to swap two variables using pointers.
7-Mark Questions:
1. Write a program to demonstrate pointer arithmetic by performing addition and
subtraction operations.
2. Write a C program to use pointers to call a function and display the result.

VISIT :- https://gtustudy.com/ 3
GTUSTUDY.COM

Chapter 7: Structures and Unions


3-Mark Questions:
1. What is a structure in C? Define and explain its use.
2. What is a union? How does it differ from a structure?
3. Define and explain the use of an array of structures.
4-Mark Questions:
1. Write a program to define a structure to store student information (name, roll
number, marks) and print the details.
2. Explain the concept of pointers to structures and give an example.
7-Mark Questions:
1. Write a C program to demonstrate the use of structures and arrays of structures to
store employee information.
2. Explain the concept of unions with an example and discuss its advantages and
limitations.

Chapter 8: File Handling


3-Mark Questions:
1. Explain file handling in C. What are the basic file operations?
2. Define file pointers in C.
3. What is the difference between text files and binary files in C?
4-Mark Questions:
1. Write a C program to open a file, read its content, and display it on the screen.
2. Discuss the process of opening and closing a file in C with example functions.
7-Mark Questions:
1. Write a program to copy the contents of one file to another using file handling
functions in C.
2. Explain the use of file pointers in file operations, and write a program to append data
to an existing file.

VISIT :- https://gtustudy.com/ 4
GTUSTUDY.COM

Chapter 9: Dynamic Memory Allocation


3-Mark Questions:
1. What is dynamic memory allocation in C?
2. Explain the malloc and calloc functions with examples.
3. How does the realloc function work in C?
4-Mark Questions:
1. Write a C program using malloc to dynamically allocate memory for an array of
integers and display the values.
2. Discuss the use of free function in C to release dynamically allocated memory.
7-Mark Questions:
1. Write a program that uses malloc, calloc, and free functions to dynamically allocate
and deallocate memory for a matrix.
2. Explain the difference between malloc and calloc with an example of their usage.

Chapter 10: Debugging and Testing


3-Mark Questions:
1. What are common debugging techniques used in C programming?
2. Define unit testing in software development.
3. List common debugging tools used in programming.
4-Mark Questions:
1. Explain the importance of writing test cases and their role in debugging.
2. Discuss the methods of debugging C programs using tools like GDB.
7-Mark Questions:
1. Write a program to debug and test a simple C program (e.g., for finding the largest of
three numbers).
2. Discuss the process of debugging a C program step by step using print statements
and a debugger.

VISIT :- https://gtustudy.com/ 5
GTUSTUDY.COM

*Disclaimer:*

The information contained in this document is provided "as is" for


general information purposes only. By choosing to read this PDF, you
assume all risks associated with its content. If you decide not to read or
fully understand the material, that is your choice and responsibility. The
creators or distributors of this document bear no liability for
misunderstandings, omissions, or outcomes resulting from the decision
not to engage with its contents. Proceed at your own discretion.

VISIT :- https://gtustudy.com/ 6

You might also like