Skills101
← C Programming — Beginner

C Programming Beginner — Test 1

15 questions15 minPass: 60%+20 XP on first passFree sample test

15 questions · 15 minutes · beginner level, with an explanation for every answer.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    What is the output?

    #include <stdio.h>
    int main() {
        printf("%d %d", 10 > 5 && 3 > 7, !0 + !5);
        return 0;
    }
    
  2. Question 2

    Which loop always runs its body at least once?

  3. Question 3

    Which format specifier prints a double with printf?

  4. Question 4

    What is the output?

    #include <stdio.h>
    int main() {
        int a = 17, b = 5;
        printf("%d %d %.1f", a / b, a % b, (float)a / b);
        return 0;
    }
    
  5. Question 5

    What is the output?

    #include <stdio.h>
    int main() {
        int x = 10;
        if (x = 0)
            printf("zero");
        else
            printf("%d", x);
        return 0;
    }
    
  6. Question 6

    What is the output?

    #include <stdio.h>
    int main() {
        int x = 5;
        printf("%d ", x++);
        printf("%d ", ++x);
        printf("%d", x);
        return 0;
    }
    
  7. Question 7

    What is the output?

    #include <stdio.h>
    int main() {
        int s = 0;
        for (int i = 1; i <= 10; i++) {
            if (i % 2 == 0) continue;
            if (i > 7) break;
            s += i;
        }
        printf("%d", s);
        return 0;
    }
    
  8. Question 8

    Where does a C program start running?

  9. Question 9

    What is the output?

    #include <stdio.h>
    int main() {
        char c = 'A' + 3;
        printf("%c %d", c, c);
        return 0;
    }
    
  10. Question 10

    What is the output?

    #include <stdio.h>
    int main() {
        int a[5] = {1, 2};
        printf("%d %d %d", a[1], a[4], (int)(sizeof(a) / sizeof(a[0])));
        return 0;
    }
    
  11. Question 11

    What is the output?

    #include <stdio.h>
    #include <string.h>
    int main() {
        char s[] = "hello";
        printf("%d %d", (int)strlen(s), (int)sizeof(s));
        return 0;
    }
    
  12. Question 12

    What is the output?

    #include <stdio.h>
    int main() {
        int n = 5, f = 1;
        while (n > 1) f *= n--;
        printf("%d", f);
        return 0;
    }
    
  13. Question 13

    What is the value of 5 / 2 * 2 in C?

  14. Question 14

    What does #include <stdio.h> do?

  15. Question 15

    What is the output?

    #include <stdio.h>
    int main() {
        int i;
        for (i = 0; i < 5; i++);
        printf("%d", i);
        return 0;
    }
    
🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →