Computer Programming-2

Computer Programming-2

University

•

30 Qs

quiz-placeholder

Similar activities

Final Exam - Audit Sistem Informasi 2022

Final Exam - Audit Sistem Informasi 2022

University

•

26 Qs

Adversarial Search and CSP Quiz

Adversarial Search and CSP Quiz

University

•

26 Qs

IEEE Coding Cybersecurity

IEEE Coding Cybersecurity

University

•

27 Qs

Animation Quiz1

Animation Quiz1

University

•

25 Qs

ULANGAN SEMESTER GENAP MAPEL SKD

ULANGAN SEMESTER GENAP MAPEL SKD

12th Grade - University

•

25 Qs

MIS Quiz 4

MIS Quiz 4

University

•

25 Qs

220-1002   A+  1-25

220-1002 A+ 1-25

University

•

25 Qs

MOBILE DEVICE

MOBILE DEVICE

1st Grade - University

•

25 Qs

Computer Programming-2

Computer Programming-2

Assessment

Quiz

•

Computers

•

University

•

Practice Problem

•

Hard

Created by

Zeel Mehta

Used 17+ 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

How many times will the following for loop iterate?

for (int i = 0; i < 5; i++) {

// code here

}

5

4

3

2

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax of a simple for loop in C?

for (initialize; condition; increment) { }

for (initialize: condition: increment); { }

for (initialize; condition: decrement); { }

for (initialize: condition: decrement) { }

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to declare a 1-D array named "numbers" of 5 integers in C?

int numbers[ ] = {5};

numbers [5];

numbers = {5};

int numbers [5];

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet?

char str[5] = "Hello";

printf("%c", str[4]);

\0

e

l

o

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is not the correct way to initialize an array named "grades" with the values 90, 85, 95, and 80 in C?

int grade[10] ={90, 85, 95, 80};

int grades[4] = {90, 85, 95, 80};

int grades[ ] = {90, 85, 95, 80};

int grades[4] = {90, 85, 95, 80}

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following functions can be used to find the length of a string in C?

strlenn()

strnlen()

strlen()

strlan()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet?

char str1[10] = "Hello";

char str2[20] = {'H', 'e', 'l', 'l', 'o', ' ','\0'};

if (strcmp(str1, str2) == 0) {

printf("Equal");

} else {

printf("Not equal");

}

Runtime Error

Equal

Compile time Error

Not Equal

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?

Discover more resources for Computers