Skip to content
KALANBLON
Show contents

Chapter 4 of 4 · 10 min

Quiz: your first steps in C

Compiling, the structure of a program, variables and types: let's check that the basics of C are in place. You need 70% correct answers.

Quiz

6 questions · pass mark: 70%

  1. 1.You changed hello.c and then ran ./hello, but the old message is still displayed. Why?

    One answer

  2. 2.What does this program display?

    One answer

    #include <stdio.h>
    
    int main(void) {
        printf("%d\n", 17 / 5);
        return 0;
    }
  3. 3.Which declarations are correct in C? (several answers)

    Several answers possible

  4. 4.Fill in the format to display a double with two decimal places.

    Complete the code

    double total = 12.5;
    printf("%____\n", total);
  5. 5.What does return 0; at the end of main mean?

    One answer

  6. 6.Which command compiles mycode.c into an executable called mycode, with warnings?

    One answer

Your progress is saved on this device. Create a free account to keep your progress on all your devices.