Sample Question Bank
Subject- Fundamental of Computer Programming
1. Write an algorithm and design a flowchart for finding maximum out of three
numbers entered by user.
2. Write an algorithm and design a flowchart for
a. To find the factorial of the given number.
b. Check whether given number is odd or even.
c. To check whether the given number is prime or not.
3. List and explain different data types available in C with example.
4. Explain the features of C.
5. Explain the Basic structure of ‘C’ program with diagram.
6. Explain enum datatype and typedef datatype with an example.
7. Enlist types of operators in C and explain each operator with an example.
8. Explain if…else statement with example.
9. Differentiate nested if…else and else-if ladder with proper example.
10. Write down Syntax of switch case and explain it with an example.
11. Differentiate: entry-controlled loop and exit-controlled loop.
12. Explain while loop with its syntax, flow chart and example.
13. Write down syntax for do…while loop and also draw the flowchart for it.
14. Write a program to find smallest number among three numbers using nested
if...else statement.
15. Write a C program to create basic calculator using switch case.
16. Write a C program to find factorial of a given number.
17. Write a program to print the following pattern using loop:
a. b.
***** 1
**** 22
333
***
4444
** 55555
*
c. d.
AAAAA A
BBBB AB
CCC ABC
DD ABCD
E ABCDE
18. Explain one-dimensional array, two-dimensional array and multi-dimensional
array with their syntax and example.
19. Write a program to multiply two matrixes of 2* 2.
20. What is string? Explain with example how to initialize string.
21. Enlist and explain string library function.
22. Write a program to perform all string function using switch case.
23. Explain the three elements of the function.
24. Enlist and explain categories of function with an example.
25. Write a program to find factorial of a number using recursion
26. What is structure? How to access the elements of structure? Explain with example.
27. Define a structure type employee that would contain person name, date of joining
and salary. Using this structure, write a program to read this information for one
employee and display on screen.
28. Explain structure within structure with syntax and example.
29. Define: Union. Give the comparison between structure and union.
30. What is pointer? Explain Declaration and Initialization of pointer variable with
example.
31. Write a function using pointers to swap the values stored in two locations in the
memory.
32. Enlist and explain various file management function in C.
33. Explain fopen() and its mode with example.
34. Define dynamic memory allocation. Explain usage of malloc() and calloc().