Code-A-Vita

Code-A-Vita

University

20 Qs

quiz-placeholder

Similar activities

Artificial Intelligence CT-1

Artificial Intelligence CT-1

University

20 Qs

ICT 0513 - Chapter 4 : System Unit

ICT 0513 - Chapter 4 : System Unit

University

15 Qs

Pra UPS 2

Pra UPS 2

University

20 Qs

From Binary To Denary Conversion - IGCSE

From Binary To Denary Conversion - IGCSE

7th Grade - Professional Development

20 Qs

DWDM-2

DWDM-2

University

20 Qs

IGH Test de Entrada

IGH Test de Entrada

University

20 Qs

Relational Algebra and Calculus

Relational Algebra and Calculus

University

20 Qs

Code-A-Vita

Code-A-Vita

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

CODE-A-VITA CODE-A-VITA

Used 4+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The variable a is not initialized correctly.

The variable b is not declared correctly.

The variable c is not initialized correctly.

The variable d is not declared correctly.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The condition in the for loop is incorrect.

The semicolon ; at the end of the for loop line makes the loop body empty

The printf statement is outside the loop, so it will only print number 6.

The variable i is not initialized properly.

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Syntax error in the printf statement

Division by zero error

Incorrect variable type declaration

No error in the code

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The loop condition is incorrect, causing an off-by-one error.

There is no error; the program will always print "Sum is exactly 1.0".

The comparison sum == 1.0 is incorrect due to the nature of floating-point arithmetic.

The variable sum should be of type double for the summation to be accurate.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Change the function declaration to int sqr(int n);

Change the function call in main to result = square(number);

Change the function definition to int sqr(int n) { return n * n; }

Change the printf statement to printf("The square of %d is %d.\n", number, square);

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The MAX macro is incorrectly defined.

The MAX macro does not need parentheses.

The printf statement is incorrect.

There is no error in the code.

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The pointer p is not initialized correctly.

The statement *p = a + 5; is incorrect and will not compile.

There is no error in the code; it will print "The value of a is: 15".

The printf statement uses the wrong format specifier.

Create a free account and access millions of resources

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?