Programming Concepts Quiz

Programming Concepts Quiz

University

10 Qs

quiz-placeholder

Similar activities

UAS Praktikum: Logika dan Algoritma Pemrograman

UAS Praktikum: Logika dan Algoritma Pemrograman

1st Grade - University

10 Qs

C++ Quiz-1

C++ Quiz-1

University

15 Qs

Java Programming-1

Java Programming-1

University

10 Qs

Java Quiz based on array

Java Quiz based on array

University

15 Qs

Python Round 4

Python Round 4

University

7 Qs

BASIC C QUIZ

BASIC C QUIZ

University

15 Qs

C++ Array

C++ Array

University

10 Qs

module3

module3

University

15 Qs

Programming Concepts Quiz

Programming Concepts Quiz

Assessment

Quiz

Computers

University

Hard

Created by

Harsha Kannuru

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly initializes an array of integers with 5 elements?

int[] array = new int[5];

int array = new int[5];

int array = new int[];

int array = new int(5);

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index of the first element in an array?

0

1

Depends on array type

-1

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary difference between a while loop and a do-while loop?

A while loop checks the condition after executing the loop body.

A do-while loop checks the condition before executing the loop body.

A while loop checks the condition before executing the loop body.

A do-while loop does not check any condition.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet? int i = 0; while (i < 3) { Console.WriteLine(i); i++; }

0 1 2

0 1 2 3

1 2 3

1 2

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about a do-while loop?

It will execute at least once even if the condition is false.

It will not execute if the condition is false.

It checks the condition before executing the loop body.

It is used only for infinite loops.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following conditions will cause the loop to exit immediately?

while (true)

do {} while (false)

while (1)

do {} while (1)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method would you use to get the length of a string in C#?

str.Size()

str.Length

str.GetLength()

str.Count()

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?