Coding Skill Test -I

Coding Skill Test -I

University

40 Qs

quiz-placeholder

Similar activities

Soal WAN Tkj kls 2

Soal WAN Tkj kls 2

University

41 Qs

Microsoft Excels: Formulas and Functions

Microsoft Excels: Formulas and Functions

12th Grade - University

45 Qs

Class Test 1 - CSE 443 (Mobile Telecommunication)

Class Test 1 - CSE 443 (Mobile Telecommunication)

University

40 Qs

OS Quiz 2 LH18

OS Quiz 2 LH18

University

45 Qs

PENILAIAN TENGAH SEMESTER INFORMATIKA

PENILAIAN TENGAH SEMESTER INFORMATIKA

8th Grade - University

35 Qs

MTA Windows OS Fundamentals Test 1

MTA Windows OS Fundamentals Test 1

9th Grade - Professional Development

35 Qs

Ôn Tập Học Kì I Lớp 4

Ôn Tập Học Kì I Lớp 4

4th Grade - University

35 Qs

Post test Keamanan Jaringan

Post test Keamanan Jaringan

University

40 Qs

Coding Skill Test -I

Coding Skill Test -I

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

ANAND PUROHIT

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

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

40 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the basic data types available in C?

boolean

array

string

int, float, double, char, void

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the difference between 'if' and 'switch' control structures.

The 'if' structure is for conditional checks, while 'switch' is for evaluating multiple cases based on a single expression.

'if' is a function, while 'switch' is a variable type.

'if' is used for loops, while 'switch' is for single conditions.

'if' can only handle two cases, whereas 'switch' can handle more than two.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a function in C and how is it defined?

A function in C is a variable that stores data.

A function in C is a type of loop used for iteration.

A function in C is a block of code defined with a return type, name, and parameters, used to perform specific tasks.

A function in C is a keyword that defines a data structure.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Describe recursion and provide an example of a recursive function.

A function to calculate the sum of an array: function sum(arr) { return arr.reduce((a, b) => a + b, 0); }

A function to reverse a string iteratively: function reverse(str) { let reversed = ''; for (let i = str.length - 1; i >= 0; i--) { reversed += str[i]; } return reversed; }

A function to find the maximum number in an array: function max(arr) { return Math.max(...arr); }

A recursive function to calculate factorial: function factorial(n) { if (n === 0) { return 1; } else { return n * factorial(n - 1); } }

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a pointer in C and how is it used?

A pointer in C is a special kind of loop used for iteration.

A pointer in C is a type of function that returns a variable.

A pointer in C is a variable that stores a string value.

A pointer in C is a variable that holds the address of another variable, used for direct memory access and manipulation.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you dynamically allocate memory in C?

Use malloc(), calloc(), realloc(), and free() functions.

Use printf() to allocate memory.

Use free() to allocate memory.

Use strcpy() for dynamic memory allocation.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a structure in C?

To manage memory allocation in C.

To define functions in C.

The purpose of a structure in C is to group different data types into a single unit.

To create loops in C.

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