Coding Skill Test -I

Quiz
•
Computers
•
University
•
Medium
ANAND PUROHIT
Used 2+ times
FREE Resource
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.
Create a free account and access millions of resources
Similar Resources on Wayground
45 questions
IP MIDTERM

Quiz
•
University
40 questions
Informatika XII

Quiz
•
12th Grade - University
38 questions
TIN HOC 10 15P

Quiz
•
10th Grade - University
40 questions
Java-Collections

Quiz
•
University
40 questions
Android Development Associate

Quiz
•
University
41 questions
Midterm prep 7th

Quiz
•
7th Grade - University
40 questions
Basic Algorithm in C (Data type, Expression, Branching, Looping)

Quiz
•
University
40 questions
Quizz PTS Kelas XI Struktur Data Array

Quiz
•
11th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University