C Quiz: Functions & Prototypes

This C quiz covers the basics of functions, from return values and void functions to prototypes. You will predict what function calls return and spot calls the compiler rejects.

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

मोड चुनें

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

सैंपल सवाल

सवाल 1 / 10

What does this print?

#include <stdio.h>

int square(int n) {
    return n * n;
}

int main(void) {
    printf("%d\n", square(3) + square(2));
    return 0;
}
जवाब दिखाएं

C. 13 Each call is evaluated on its own: square(3) is 9 and square(2) is 4, so the sum is 13. 25 would be square(3 + 2).

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

  • Defining functions with parameters and a return type
  • void functions and return
  • Prototypes and why they come before the call
  • int f(void) vs int f()
  • Return value conversions and nested calls

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

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

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

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

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