Search Header Logo

Pretest

Authored by leonard peligro

Other

Vocational training

Used 1+ times

Pretest
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to include a standard input-output library in C?

  • A. #include <iostream>

  • B. #include <stdio.h>

  • C. #include <stdlib.h>

  • D. #include <string.h>

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default return type of the main() function in C?

void

int

float

char

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a variable named count of type int in C?

  • A. int count;

  • B. count int;

  • C. variable count = int;

  • D. int count = int;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the printf() function in C?

  • A. To take input from the user

  • B. To print output to the console

  • C. To store data in a file

  • D. To perform arithmetic operations

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to write a single-line comment in C?

  • A. /* This is a comment*/

  • B. -- This is a comment

  • C. // This is a comment

  • D. # This is a comment

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for a for loop in C?

  • A. for (i = 0; i < 10; i++)

  • B. for (i = 0; i < 10; i--)

  • C. for i = 0 to 10

  • D. for (i < 10; i++)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

int x = 5; printf("%d", x++);

5

6

undefined

error

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?