Batch 2_Updated

Batch 2_Updated

University

30 Qs

quiz-placeholder

Similar activities

ITE6 Prelim exam BSIT 2-3

ITE6 Prelim exam BSIT 2-3

University

25 Qs

Video Games

Video Games

KG - University

28 Qs

Copyrights issue

Copyrights issue

University

26 Qs

CCC4 Chapter 1 - Introduction to Computers

CCC4 Chapter 1 - Introduction to Computers

University

25 Qs

Arduino

Arduino

University

25 Qs

Advanced Game Design Midterm

Advanced Game Design Midterm

University

25 Qs

Understanding Loops in Programming

Understanding Loops in Programming

University

25 Qs

sheet 3

sheet 3

University

25 Qs

Batch 2_Updated

Batch 2_Updated

Assessment

Quiz

Computers

University

Practice Problem

Easy

Created by

Arunsundar Balasubramanian

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 is the primary difference between static keyword used inside a function and outside a function (at file scope)?

Inside a function, it makes the variable constant; outside, it limits visibility to the current file.

Inside a function, it preserves the variable's value between calls; outside, it limits visibility to the current file.

Inside a function, it makes the variable accessible only within the function; outside, it makes the variable global.

Inside a function, it makes the variable thread-safe; outside, it makes the variable read-only.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider this code: int *ptr = malloc(10 * sizeof(int));. What is the most likely problem if malloc fails?

The program will crash immediately.

ptr will be a null pointer.

ptr will point to garbage memory.

The program will compile with a warning.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to deallocate memory allocated with calloc?

free(calloc_ptr);

dealloc(calloc_ptr);

free(calloc_ptr, size); (where size is the allocated size)

delete calloc_ptr;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a potential issue with using gets()?

It's slow.

It can cause a buffer overflow.

It can only read strings of a fixed length.

It's deprecated but still safe to use if you're careful.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of this code snippet? #include int main() { int arr[] = {1, 2, 3, 4, 5}; int *ptr = arr; printf("%d\n", *(ptr + 2)); return 0; }

1

2

3

4

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these is NOT a standard C header file?

stdio.h

string.h

iostream.h

math.h

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does volatile keyword signify in C?

The variable's value will not be changed.

The variable might be changed by something outside the program's control.

The variable will be stored in a register.

The variable is thread-safe.

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?