Q1. What is an algorithm?
An algorithm is a finite step-by-step procedure to solve a given problem.
Q2. What is a flowchart?
A flowchart is a graphical representation of an algorithm using symbols like oval, rectangle, and
diamond.
Q3. What is pseudocode?
Pseudocode is an informal, English-like representation of program logic without syntax rules.
Q4. Name two advantages of flowcharts.
Easy understanding of logic and easier debugging.
Q5. What is a computer program?
A program is a set of instructions given to a computer to perform a task.
Q9. What is a compiler?
A compiler translates high-level code into machine code.
Q11. Who developed C language?
Dennis Ritchie.
Q13. What is the structure of a C program?
Documentation → Preprocessor → Global declarations → main() → User-defined functions.
Q14. What is main() function?
Execution of a C program starts from main().
Q15. What is an identifier?
A name given to variables, functions, or arrays.
Q16. Give rules for identifiers.
Must start with letter/underscore, no spaces, no keywords.
Q17. What are basic data types in C?
int, float, char, double.
Q18. What is the size of char?
1 byte.
Q19. What is a variable?
A variable is a named memory location whose value can change.
Q20. What is a constant?
A constant is a fixed value that cannot be changed.
Q21. What is printf()?
Used to display output on the screen.
Q22. What is scanf()?
Used to read input from the user.
Q23. What are arithmetic operators?
+, -, *, /, %.
Q24. What are relational operators?
<, >, <=, >=, ==, !=.
Q25. What are logical operators?
&&, ||, !.
Q26. What are bitwise operators?
&, |, ^, ~, <<, >>.
Q27. What is conditional operator?
?: — used for conditional expressions.
Q28. What are increment and decrement operators?
++ and --.
Q29. What is assignment operator?
= and compound operators like +=, -=.
Q30. What is an expression?
A combination of variables, constants, and operators.
Q31. What is operator precedence?
Priority order in which operators are evaluated.
Q32. What is associativity?
Direction of evaluation (left to right or right to left).
Q33. What is type conversion?
Conversion of one data type to another.
Q34. What is if statement?
Used for decision making based on condition.
Q35. What is switch statement?
Used for multi-way selection based on constant values.
Q36. What is while loop?
Entry-controlled loop.
Q37. What is do-while loop?
Exit-controlled loop.
Q38. What is for loop?
Loop with initialization, condition, and increment.
Q39. What is break statement?
Terminates the loop or switch.
Q40. What is continue statement?
Skips current iteration and continues loop.
Q41. What is goto statement?
Transfers control unconditionally to a label.
Q42. What is a function?
A block of code that performs a specific task.
Q43. What is inter-function communication?
Passing data between functions using arguments and return values.
Q44. What is scope of a variable?
Region where variable is accessible.
Q45. What is lifetime of a variable?
Duration for which variable exists in memory.
Q46. What is auto storage class?
Default storage class for local variables.
Q47. What is register storage class?
Stores variable in CPU register.
Q48. What is static storage class?
Preserves value between function calls.
Q49. What is extern storage class?
Access global variable defined in another file.
Q52. What is C preprocessor?
Processes directives before compilation.
Q53. Give examples of preprocessor directives.
#include, #define, #ifdef.
Q54. What is recursion?
A function calling itself.
Q1. What is an array?
An array is a collection of similar data types stored in contiguous memory locations.
Q2. How do you declare an array in C?
int a[10];
Q3. What is an array subscript?
The index used to access array elements, starting from 0.
Q4. How do you reference an array element?
Using index notation: a[2].
What is linear search?
A search technique that checks each element sequentially.
What is binary search?
A search technique that works on sorted arrays by dividing the search space.
Q11. What is bubble sort?
A sorting method that repeatedly swaps adjacent elements if they are in wrong order.
Q12. What is insertion sort?
Builds sorted array by inserting elements at correct position.
Q13. What is selection sort?
Selects the smallest element and places it in correct position.
Q15. What is a two-dimensional array?
An array of arrays, used to represent matrices.
Q16. How do you declare a 2D array?
int a[3][3];
Q19. What is a multidimensional array?
An array with more than one dimension.
Q20. Give example of 3D array declaration.
int a[2][3][4];
Q21. What is a pointer?
A variable that stores the address of another variable.
Q22. How do you declare a pointer?
int *p;
Q23. What does & operator do?
Returns the address of a variable.
Q25. What are pointer types?
int pointer, char pointer, float pointer, etc.
Q26. What is a NULL pointer?
A pointer that points to nothing.
Q31. What is an array of pointers?
An array where each element is a pointer.
Q32. Give example.
char *names[5];
Q33. What is a pointer to pointer?
A pointer that stores the address of another pointer.
Q34. Give example.
int **pp;
Q35. What is a function pointer?
A pointer that stores address of a function.
Q38. What is dynamic memory allocation?
Allocating memory at runtime.
Q39. Which functions are used for dynamic memory?
malloc(), calloc(), realloc(), free().
Q40. What does free() do?
Releases allocated memory.
Q41. What is a string?
An array of characters ending with null character (\0).
Q42. How do you declare a string?
char str[20];
Q43. What does strcpy() do?
Copies one string into another.
Q44. What does strlen() do?
Returns length of string.
Q45. What does strcat() do?
Concatenates two strings.
Q46. What does strcmp() do?
Compares two strings.