PRINCIPLES OF PROGRAMMING WITH C
Question Bank
Module 1
1. Explain basic structure of c program with example
2. Implement C program to calculate simple interest.
3. Explain the different operators with example.
4. Illustrate different types of increment/decrement operators and write a C program to
demonstrate it.
5. Write a C program to convert the distance to meter, feet, inches and in centimetre. (Note: Enter
the distance between two cities (in km) as input through the keyboard.)
6. Explain the different Data Types in C with suitable C code snippet.
7. Illustrate Bitwise operators and explain with a suitable example.
8. What will be the output of the following? Explain in detail.
#include<stdio.h>
void main()
{
int a = 10, b = 25;
a = b++ + ++a;
b = ++b + ++a;
printf("%d %d ", a, b);
}
9. Define identifier. Explain the rules for constructing an identifier.
10. Implement C program to find the area of circle.
11. Explain C keywords with example.
12. Explain type casting with an example.
13. Write a C program to check whether the student is pass or fail using conditional operator.
14. Write a C program to convert the given temperature from Fahrenheit to Celsius.
Module 2
1. Explain formatted and unformatted I/O statement with example
2. Explain the syntax for switch statement. Implement C program for finding roots of quadratic
equation, using switch.
3. Compare looping statements with suitable examples.
4. Implement C program to find -Largest of three numbers, Find cubic root of a number.
5. Write a C program to compute the binomial co-efficient.
6. Write a C program to print the following pattern.
a. * * * * * * * b. *
******* * *
******* * * *
Ms. Madhu R, Dept. of ISE, SCEM, Mangaluru
7. Explain 4 different types of storage classes in C.
8. Explain Cascade-if statement with an example.
9. Explain nested-if statement with an example.
10. Write a C program to display Pascal’s triangle.
11. Write a C program to print the given number in word using switch. (Example: Input: 123
Output: OneTwoThree)
12. Write a menu-driven C program to compute the area of various geometric shapes.
13. Write a C program to find the sum of first and last digit of a given number. (Example:
Input:1235; Output: 6)
14. Write a C program to check whether the given number is palindrome or not.
15. Write a C program to convert decimal number to binary/ binary to decimal.
16. Write a C program to check whether the character is uppercase or lowercase alphabet.
17. Write a C program to check whether given year is leap year or not.
18. Write a C program to find sinx using Taylor Series.
Module 3
1. Demonstrate selection sort technique using C program. (Note: number of elements n=10)
2. Demonstrate the working of linear search for the given elements {2, 0, 1,12,5,2,7,
11,19,22,100,210} with key=120.
3. Illustrate how to declare and initialize arrays and strings.
4. Explain declaration and initialization of 1D and 2D array with syntax and an example program.
5. Demonstrate the working of bubble sort for the following numbers. Int z[ ] = { 12, 0, -3, 6, 201,
3} arrange in descending order.
6. Write a C program to multiply 2 matrices.
7. Illustrate the working of binary search with an algorithm.
8. Write a C program to print largest and smallest word from a given sentence. If there are 2 or
more word of same length then consider the 1st word. A single letter is also considered as a
word. (Input: AICTE Approved FDP Output: Largest=Approved Smallest=FDP)
9. Write a C program to delete the duplicate character from a string.
10. Write a C program to find the sum of two matrices.
11. Write a C program to find the sum of a smallest and largest element in an array.
12. Write a C program to display identity Matrix.
13. Write a C program to Transpose a Matrix A.
14. Demonstrate the working of insertion sort.
15. Explain binary search algorithm with an example.
Module 4
1. Categorize user defined functions based on the return type and input parameters. Write a C
Program to demonstrate the use of recursion to print Fibonacci series.
2. Explain the structure of a function with examples.
Ms. Madhu R, Dept. of ISE, SCEM, Mangaluru
3. Implement call by reference and call by value concepts to swap two values.
4. Utilize and implement user defined functions for Binary to Decimal Conversion.
5. Explain the key elements of user defined function.
6. Write a C program to express a given integer as sum of 2 prime numbers using functions.
7. Write a C program to find the Fibonacci series and factorial of a number using recursive
function.
8. Write a C program to Encrypt and Decrypt a password
9. Write a c program to read and display book information using structure.
10. Explain structure with declaration, initialization and accessing structure member with an
example.
11. Write a C program to reverse a Number using Recursion.
12. Write a c program to display below average and average student details using structure and
function.
13. Demonstrate a C Program to read and print N student record (record should contain Name, roll
number, marks) using structures.
Module 5
1. What is dynamic memory allocation? Explain the library functions that facilitate dynamic
memory allocation in C programming.
2. Explain pre-processor directives with examples. Write a directive that defines “MESSAGE”
only if “MESSAGE isn't already defined.
3. Illustrate the initialization and declaration of pointers. Demonstrate a C program to swap two
variables by passing address to a function.
4. Write a function using pointers to exchange the values stored in 2 locations in the memory.
5. Differentiate between structure and union.
6. Write a C program to find the sum, mean and standard deviation of an array elements using
pointer.
7. Write C program to read and print student details using structure pointer, demonstrate
example of structure with pointer
8. Explain Dangling Pointer. Explain why it is dangerous? How to overcome this problem?
9. Explain double pointer with an example.
10. Write a C program to explain the concept of file-open and file-close.
11. Write a C program to arrange array elements in descending order using pointer.
12. Explain file system.
Ms. Madhu R, Dept. of ISE, SCEM, Mangaluru