C Programming Language Certified Associate Practice Exam, Exams of Technology

A practice exam for the clacla c programming language certified associate certification. It includes multiple-choice questions covering fundamental concepts of the c programming language, such as data types, operators, control structures, and memory management. Each question is followed by a detailed explanation of the correct answer, making it a valuable resource for students and professionals preparing for the certification exam. The practice exam helps reinforce understanding of key concepts and identify areas for further study. It is designed to assess knowledge and skills in c programming, providing a comprehensive review of essential topics.

Typology: Exams

2024/2025

Available from 12/02/2025

shilpi-jain-1
shilpi-jain-1 🇮🇳

4.2

(5)

29K documents

1 / 129

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CLACLA C Programming Language Certified
Associate Practice Exam
**Question 1.** Which of the following is NOT a characteristic of a highlevel
programming language?
A) Platform independence
B) Direct manipulation of CPU registers
C) Use of Englishlike syntax
D) Automatic memory management
Answer: B
Explanation: Highlevel languages abstract away hardware details such as CPU
registers; direct register manipulation is a feature of lowlevel or assembly
languages.
**Question 2.** In the compilation process, which stage translates source code
into assembly language?
A) Preprocessing
B) Lexical analysis
C) Code generation
D) Linking
Answer: C
Explanation: After preprocessing and parsing, the compiler’s codegeneration
phase emits assembly (or machine) code from the intermediate representation.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download C Programming Language Certified Associate Practice Exam and more Exams Technology in PDF only on Docsity!

Associate Practice Exam

Question 1. Which of the following is NOT a characteristic of a high‑level programming language? A) Platform independence B) Direct manipulation of CPU registers C) Use of English‑like syntax D) Automatic memory management Answer: B Explanation: High‑level languages abstract away hardware details such as CPU registers; direct register manipulation is a feature of low‑level or assembly languages. Question 2. In the compilation process, which stage translates source code into assembly language? A) Preprocessing B) Lexical analysis C) Code generation D) Linking Answer: C Explanation: After preprocessing and parsing, the compiler’s code‑generation phase emits assembly (or machine) code from the intermediate representation.

Associate Practice Exam

Question 3. Which of the following is the correct minimal structure of a C program? A) int main(){} B) void start(){} C) program(){} D) main(){} Answer: A Explanation: The C standard requires a function named main returning int; an empty body is syntactically valid. Question 4. Which token is a keyword in C? A) myVar B) 42 C) while D) #include Answer: C Explanation: while is reserved by the language; identifiers, literals, and preprocessing directives are not keywords.

Associate Practice Exam

Question 7. What is the difference between a declaration and a definition of a variable? A) Declaration allocates storage; definition does not. B) Declaration introduces the name; definition also allocates storage. C) Declaration must include an initializer; definition must not. D) There is no difference. Answer: B Explanation: A declaration tells the compiler about the variable’s type and name; a definition also reserves memory for it. Question 8. Which statement correctly declares and initializes an int variable? A) int count; B) int count = 10; C) extern int count; D) static int; Answer: B Explanation: int count = 10; both declares the variable and provides an initializer.

Associate Practice Exam

Question 9. Which storage class gives a variable internal linkage and static duration? A) auto B) extern C) static D) register Answer: C Explanation: static at file scope gives internal linkage and static storage duration. Question 10. Which storage class is most appropriate for a variable that must be accessed by multiple source files? A) auto B) static C) extern D) register Answer: C Explanation: extern declares a variable defined elsewhere, allowing external linkage across translation units.

Associate Practice Exam

Question 13. How do you declare a pointer to a structure Point named pPtr? A) struct Point *pPtr; B) struct *Point pPtr; C) Point *pPtr; D) *struct Point pPtr; Answer: A Explanation: struct Point *pPtr; declares a pointer to a struct Point. Option C would be valid only after a typedef. Question 14. Which statement correctly creates an array of 5 struct Point objects named points? A) struct Point points[5]; B) struct Point points = 5; C) struct Point[5] points; D) points[5] struct Point; Answer: A Explanation: The syntax struct Point points[5]; declares an array of five struct Point elements.

Associate Practice Exam

Question 15. Which of the following is a recursive data structure? A) int arr[10]; B) struct Node { int data; struct Node *next; }; C) float matrix[3][3]; D) char *string; Answer: B Explanation: struct Node contains a pointer to the same type, enabling recursive linking (e.g., linked list). Question 16. Which integer literal is interpreted as octal? A) 0x1F B) 075 C) 0b1010 D) 123 Answer: B Explanation: An integer literal beginning with 0 (but not 0x) is octal. 075 = decimal 61. Question 17. What is the value of the expression 0xFF + 1?

Associate Practice Exam

B) "A"

C) '\x41' D) Both A and C Answer: D Explanation: 'A' and '\x41' both represent the character with ASCII code 65. Question 20. In an expression, what is the result of adding an int and a char? A) The char is promoted to int and the result is int. B) The int is truncated to char. C) The result is of type char. D) Compilation error. Answer: A Explanation: Integer promotions convert char to int; the arithmetic result is of type int. Question 21. What is the result of 7 % 3? A) 1 B) 2

Associate Practice Exam

C) 0

D) 3

Answer: A Explanation: The modulo operator yields the remainder; 7 divided by 3 leaves remainder 1. Question 22. Which relational operator tests for greater than or equal? A) > B) < C) >= D) == Answer: C Explanation: >= returns true when the left operand is greater than or equal to the right operand. Question 23. Which logical expression is equivalent to !(a && b)? A) !a && !b B) !a || !b C) a || b

Associate Practice Exam

Answer: A Explanation: << shifts bits toward more significant positions; shifting by 2 multiplies by 4 for unsigned integers. Question 26. What is the effect of the compound assignment a += 5? A) a = a + 5 B) a = 5 + a C) a = a - 5 D) a = a * 5 Answer: A Explanation: += adds the right‑hand operand to the left‑hand variable and stores the result. Question 27. After the statement int i = 5; i++;, what is the value of i? A) 4 B) 5 C) 6 D) Undefined

Associate Practice Exam

Answer: C Explanation: Post‑increment adds 1 after yielding the original value; the variable ends up as 6. Question 28. In the expression ++i + i++, assuming i starts at 3, what is the final value of i after the full expression is evaluated? A) 4 B) 5 C) 6 D) Undefined behavior Answer: D Explanation: Modifying i more than once between sequence points without an intervening sequence point causes undefined behavior. Question 29. Which operator has higher precedence? A) * (multiplication) B) + (addition) C) && (logical AND) D) = (assignment)

Associate Practice Exam

Answer: A Explanation: C uses the (type) syntax for explicit casts. Question 32. What does the unary & operator produce? A) The value stored at an address B) The address of its operand C) Bitwise AND of two operands D) Logical NOT Answer: B Explanation: & yields a pointer to its operand (the operand’s address). Question 33. Which declaration defines a pointer to int named p and initializes it to point to x? A) int *p = &x; B) int p = &x; C) int &p = x; D) int *p = x; Answer: A

Associate Practice Exam

Explanation: int *p = &x; creates a pointer p that holds the address of x. Question 34. What is the value of a NULL pointer? A) 0 B) -1 C) An address that points to the first byte of memory D) Undefined Answer: A Explanation: In C, the macro NULL expands to an implementation‑defined null pointer constant, commonly integer constant 0. Question 35. Which statement correctly declares a generic pointer? A) void *gp; B) generic *gp; C) void gp; D) any *gp; Answer: A Explanation: void * is the type for a generic pointer that can be converted to/from any object pointer.

Associate Practice Exam

Question 38. If int *p; int a[10];, which of the following assignments is valid? A) p = a; B) p = &a; C) p = a[0]; D) p = *a; Answer: A Explanation: In most expressions, an array decays to a pointer to its first element, so p = a; assigns int * correctly. Question 39. Which of the following correctly computes the number of elements in an array int data[20];? A) sizeof(data) / sizeof(int) B) sizeof(data) / sizeof(data[0]) C) sizeof(data[0]) * 20 D) sizeof(data) * 20 Answer: B Explanation: sizeof(data) gives total size; dividing by size of one element (data[0]) yields element count.

Associate Practice Exam

Question 40. In memory, where are static variables typically stored? A) Stack B) Heap C) Data segment (BSS or initialized data) D) Register Answer: C Explanation: Static storage duration variables reside in the program’s data segment, not on the stack or heap. Question 41. Which statement correctly uses the break keyword? A) break (i == 5); B) if (i == 5) break; C) break; inside a function body but outside any loop or switch. D) break; after a return statement. Answer: B Explanation: break terminates the nearest enclosing loop or switch. Placing it in an if inside a loop is valid.