Exercises

C Programming Basics Quiz

Put your C programming fundamentals to the test with this beginner-friendly quiz. Answer questions covering Hello World syntax, variable declarations and naming rules, single-line comments, printf output, array indexing, built-in data types, constants, the return type of main(), and the purpose of function prototypes. Whether you are new to C or reviewing core concepts before an exam, this quiz is a quick way to check your understanding of essential C language syntax and programming principles.

Answer the questions below and check the explanation for each answer.

0/10 answered

  1. 1

    What is the correct syntax to output 'Hello World' in C?

  2. 2

    Which of the following is a correct variable declaration in C?

  3. 3

    Which of these symbols is used to comment a single line in C?

  4. 4

    What is the output of the following code?
    <code>int x = 10;
    printf(<b>%d<b>, x);</code>

  5. 5

    Which of the following cannot be a variable name in C?

  6. 6

    How do you access elements of an array in C?

  7. 7

    Which of the following data types is not available in C?

  8. 8

    Which keyword is used to define a constant in C?

  9. 9

    What is the return type of the <code>main</code> function in C?

  10. 10

    What is the main purpose of a function prototype in C?

Download the App now to have access to + 5000 free courses, exercises, certificates and lots of content without paying anything!

  • 100% free online courses from start to finish

    Thousands of online courses in video, ebooks and audiobooks.

  • More than 60 thousand free exercises

    To test your knowledge during online courses

  • Valid free Digital Certificate with QR Code

    Generated directly from your cell phone's photo gallery and sent to your email

Cursa app on the ebook screen, the video course screen and the course exercises screen, plus the course completion certificate