3_sem

3_sem

University

30 Qs

quiz-placeholder

Similar activities

Quiz_3

Quiz_3

University

25 Qs

Java Programming Quiz

Java Programming Quiz

University

25 Qs

Mobile Security Quiz

Mobile Security Quiz

University

25 Qs

Quiz on Lesson 1 CSU3200

Quiz on Lesson 1 CSU3200

University

33 Qs

Kelas 9-Refreshing Berpikir Komputasional

Kelas 9-Refreshing Berpikir Komputasional

9th Grade - University

25 Qs

Quiz sobre Estruturas de Repetição em Programação

Quiz sobre Estruturas de Repetição em Programação

University

25 Qs

Preliminary Examination _ IT Era

Preliminary Examination _ IT Era

University

25 Qs

Cloud Computing Test

Cloud Computing Test

University

25 Qs

3_sem

3_sem

Assessment

Quiz

Information Technology (IT)

University

Practice Problem

Hard

Created by

AKSV AKSV

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of this code? #include <stdio.h> int main() { int i = 5; printf("%d %d %d", i, i++, ++i); return 0; }

5 5 7
7 6 7
5 6 7
Undefined Behavior

Answer explanation

Undefined order of evaluation leads to undefined behavior.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the size of sizeof('A') in a 64-bit GCC compiler?

1
2
4
8

Answer explanation

Character constants are of type int, hence 4 bytes.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to declare a variable that retains its value across function calls?

auto
extern
static
register

Answer explanation

static retains value across function calls.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is returned by fopen() if it fails to open a file?

-1
0
NULL
EOF

Answer explanation

fopen returns NULL if it fails.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code print? #include <stdio.h> int main() { char *p = "Hello"; *p = 'M'; printf("%s", p); }

Hello
Mello
Compiler Error
Undefined Behavior

Answer explanation

Modifying string literal is undefined behavior.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a valid storage class in C?

auto
static
dynamic
register

Answer explanation

dynamic is not a C storage class.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of: printf("%d", printf("Hi"));

Hi1
Hi2
Hi0
Error

Answer explanation

printf prints 'Hi' and returns 2, so output is 'Hi2'.

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?