ควิซ C: 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, เหรียญตรา และประวัติ

ทำซ้ำได้ไหม?

ได้ ระบบเก็บคะแนนที่ดีที่สุดไว้ และสลับคำถามกับตัวเลือกใหม่ทุกครั้ง