C Programming Concepts

C Programming Concepts

University

13 Qs

quiz-placeholder

Similar activities

Quiz 2025

Quiz 2025

University

10 Qs

C Quiz

C Quiz

University

10 Qs

Day5_Arrays

Day5_Arrays

University - Professional Development

12 Qs

PRF102 - Review 2

PRF102 - Review 2

University

15 Qs

Together We Grow - 2

Together We Grow - 2

University

15 Qs

C Quiz

C Quiz

University

15 Qs

Mindzone Season-3

Mindzone Season-3

University

15 Qs

Quiz Planet (Round-2)

Quiz Planet (Round-2)

University

10 Qs

C Programming Concepts

C Programming Concepts

Assessment

Quiz

Other

University

Hard

Created by

Guntha Vishnuvardhanreddy

Used 1+ times

FREE Resource

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for declaring a variable in C?

variable_name = data_type;

data_type variable_name;

variable_name : data_type;

variable_name data_type;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between 'int' and 'float' data types in C?

int stores characters while float stores numbers

int can store negative numbers while float cannot

int is used for text data while float is used for numerical data

The main difference is that 'int' stores whole numbers, while 'float' stores numbers with decimal points.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the 'if-else' statement in C with an example.

Example: int num = 10; if(num > 5) { printf('The number is greater than 5'); } else { printf('The number is less than or equal to 5'); }

Example: int x = 5; if(x == 5) { printf('The number is equal to 5'); } else { printf('The number is not equal to 5'); }

The 'if-else' statement is used for looping in C.

Example: int num = 10; if(num < 5) { printf('The number is less than 5'); } else { printf('The number is greater than or equal to 5'); }

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of 'printf' function in C?

The purpose of 'printf' function in C is to create a new variable

The purpose of 'printf' function in C is to read input from the standard input

The purpose of 'printf' function in C is to print formatted output to the standard output.

The purpose of 'printf' function in C is to perform mathematical calculations

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare and initialize an array in C?

data_type array_name = {initialization_values};

array_name = new data_type[array_size];

data_type array_name[array_size] = {initialization_values};

array_name = malloc(array_size * sizeof(data_type));

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the concept of 'pointers' in C.

Pointers in C are used to store the value of another variable.

Pointers in C are variables that store the memory address of another variable. They are used to access and manipulate the memory directly, allowing for more efficient memory management and data manipulation.

Pointers in C are only used for accessing memory, not for manipulation.

Pointers in C are not compatible with other programming languages.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the use of 'malloc' function in C?

The 'malloc' function is used to sort arrays in C.

The 'malloc' function is used to allocate memory in C.

The 'malloc' function is used to print output in C.

The 'malloc' function is used to free memory in C.

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?

Discover more resources for Other