logo

Unit 4: Programming in C (12 Hours)

1. What is the size of an int in C?

2. Which of the following is a valid variable name in C?

3. What is the output of printf("%d", 5 + 10);?

4. Which of the following is the correct way to declare a pointer?

5. What is the purpose of the main() function in C?

6. Which operator is used to access a member of a structure?

7. How do you create a comment in C?

8. What is the result of 3 % 2 in C?

9. Which data type can hold a decimal value?

10. What will be the output of printf("%c", 'A' + 1);?

11. Which of the following is a looping statement in C?

12. What does the sizeof operator do?

13. What is the output of the following code? printf("%d", 5 < 10);

14. What is the correct way to declare an array in C?

15. Which of the following functions is used to read a string?

16. What is the purpose of the return statement in C?

17. Which header file is needed for using printf and scanf?

18. How do you declare a function in C?

19. What is the output of printf("%d", 3 * 2 + 1);?

20. What is a NULL pointer?

21. Which of the following is not a keyword in C?

22. What is the correct syntax for an if statement in C?

23. Which operator is used to allocate memory dynamically?

24. What does the break statement do?

25. Which of the following statements is used to terminate a loop?

26. What will be the output of printf("%d", 5 == 5);?

27. What is the use of the & operator?

28. What will happen if you try to access an array element out of bounds?

29. What is the output of printf("%d", 3 + 2 * 2);?

30. Which of the following is a logical operator in C?

31. How do you include a standard library in C?

32. What will be the output of printf("%d", (5 + 10) / 3);?

33. Which of the following data types can store the largest value?

34. How can you declare a constant variable in C?

35. What is the output of printf("%f", 5.0 / 2);?

36. Which function is used to find the length of a string?

37. How can you create a multi-dimensional array?

38. What is the output of printf("%d", sizeof(char));?

39. What is the keyword used for defining a macro in C?

40. Which of the following will declare a structure in C?

41. What is the output of printf("%c", 65);?

42. How do you declare a function pointer in C?

43. What is the output of the following code? printf("%d", 5 / 2);

44. What does malloc return if memory allocation fails?

45. What is the default return type of a function in C?

46. Which of the following is an invalid C declaration?

47. What will be the output of the following code? printf("%d", sizeof(int));

48. How do you access a member of a union?

49. Which of the following is not a valid C statement?

50. What is the output of printf("%d", 10 / 4);

51. What is the correct way to write an else statement?

52. What will happen if you divide an integer by zero in C?

53. How can you declare a character array in C?

54. What is the output of the following code? printf("%d", 0);

55. Which of the following correctly declares a string in C?

56. What is the size of a float in C?

57. What is the result of 3 & 1 in C?

58. Which of the following functions can be used to terminate a string?

59. Which of the following is used to declare a structure variable?

60. What is the output of printf("%d", 10 == 10);

61. How do you define a constant value in C?

62. What will be the output of printf("%d", 10 / 3);

63. What is a function prototype?

64. Which operator is used to perform bitwise OR in C?

65. What will be the output of the following code? printf("%d", 5 - 2);

66. What is the result of 5 >> 1 in C?

67. What is the correct syntax for declaring a structure?

68. Which of the following correctly defines a macro?

69. What will be the output of printf("%d", sizeof(double));

70. How can you declare a variable in C that can hold 10 integers?

71. What does fgets do in C?

72. What is the output of printf("%d", 5 + 5);

73. Which of the following is not a loop in C?

74. What is a syntax error?

75. What does the continue statement do?

76. What is the output of printf("%d", 3 * (2 + 1));

77. How do you define a function that takes two integer arguments?