Skip to content

C Programming Practice Exam

Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.

📝 50 questions · ⏱ 60 minutes · 🎯 Pass mark 70% · 🆓 Free, no signup

Exam details

  • 50 questions drawn from 170 cards
  • Countdown timer — auto-submits when time runs out
  • Pass mark 70% (real certification threshold)
  • Full review of wrong answers at the end
  • No signup required — save your score with a free account

Sample Questions

5 shown

What is a pointer in C?

Show ▼

A pointer is a variable that stores the memory address of another variable.
Declared using the * operator: int *ptr;
The address-of operator & retrieves a variable's address: ptr = &x;

How do you dereference a pointer?

Show ▼

Dereferencing means accessing the value stored at the address a pointer holds.
Use the * operator: int val = *ptr;
This retrieves the value at the memory location pointed to by ptr.

What is a NULL pointer?

Show ▼

A NULL pointer is a pointer that does not point to any valid memory location.
Assigned with: int *ptr = NULL;
Always check for NULL before dereferencing to avoid segmentation faults.

What does malloc() do in C?

Show ▼

malloc() allocates a block of memory on the heap and returns a pointer to it.
Syntax: int *p = (int *)malloc(n * sizeof(int));
Returns NULL if allocation fails. Memory is uninitialized.

What is the difference between malloc() and calloc()?

Show ▼

  • malloc(size) allocates uninitialized memory of the given size
  • calloc(count, size) allocates memory for an array of count elements, each of size bytes, and initializes all bits to zero

🎯 Take the C Programming Practice Exam