C Quiz: Pointer Basics

This C quiz checks the first ideas about pointers - what & and * do, how a pointer lets a function change the caller's variable and why NULL must be checked. It is for learners who have just met pointers and want to make them click.

आसान 10 सवाल ~5 मिनट पास होने के लिए 80% C17

मोड चुनें

आप गेस्ट के तौर पर खेल रहे हैं: XP और streak सेव रखने के लिए साइन इन करें।

सैंपल सवाल

सवाल 1 / 10

What does this print?

#include <stdio.h>

int main(void) {
    int x = 5;
    int *p = &x;
    *p = 8;
    printf("%d\n", x);
    return 0;
}
जवाब दिखाएं

B. 8 p holds the address of x, so *p = 8 writes 8 into x itself. There is only one integer here, reached under two names.

इस क्विज़ में क्या है

  • &x gives an address, *p follows it
  • Changing a variable through a pointer
  • Passing pointers so a function can modify its arguments
  • Comparing pointers vs comparing the values they point to
  • NULL and the int* a, b trap

अक्सर पूछे जाने वाले सवाल

क्या अकाउंट ज़रूरी है?

नहीं। कोई भी खेल सकता है। XP, streak, badge और हिस्ट्री सेव रखने के लिए साइन इन करें।

क्या मैं इसे दोबारा दे सकता हूं?

हां। आपका बेस्ट स्कोर सेव रहता है, और हर बार सवाल और जवाब शफ़ल होते हैं।