Search Header Logo

C Programming Challenge

Authored by rudra goynar

Information Technology (IT)

University

Used 1+ times

C Programming Challenge
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the basic data types available in C?

array

int, float, double, char, void

string

boolean

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the difference between local and global variables in C.

Local variables are declared outside functions; global variables are declared inside functions.

Local variables are function-scoped; global variables are accessible throughout the program.

Local variables can be accessed globally; global variables are limited to functions.

Local variables retain their values between function calls; global variables do not.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare an array in C?

int arr[10];

arr int[10];

int[10] arr;

array int[10];

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'void' keyword in a function declaration?

The 'void' keyword is used to indicate a pointer type.

The 'void' keyword specifies the function's return type.

The 'void' keyword allows a function to accept any number of parameters.

The 'void' keyword indicates that a function does not return a value.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you read data from a file in C?

Use printf() to display data directly from the file.

Read data using the read() function without opening the file.

Use fopen() to open the file, then fgets() or fscanf() to read data, and fclose() to close the file.

Close the file before reading any data from it.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a string in C and how is it represented?

A string in C is a single character.

A string in C is a fixed-length integer.

A string in C is a list of numbers.

A string in C is an array of characters ending with a null character ('\0').

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Describe the use of pointers in functions.

Pointers can only be used with arrays.

Pointers prevent functions from accessing global variables.

Pointers are used to create new variables in functions.

Pointers enable functions to modify variables directly and improve efficiency by avoiding data copying.

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?