Search Header Logo

Programming in C and Data Structures

Authored by safreen safreen

Computers

University

Used 2+ times

 Programming in C and Data Structures
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 year was the C programming language developed?

1990

1972

1970

1985

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the basic structure of a C program.

The main function is optional in a C program.

A C program is structured around classes and objects.

The basic structure of a C program includes preprocessor directives, the main function, variable declarations, statements, and a return statement.

The basic structure of a C program consists only of comments and whitespace.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

List the primary data types available in C.

string

int, char, float, double

array

boolean

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between a constant and a variable in C?

Both constants and variables can change their values.

A constant can change its value, while a variable cannot.

A constant cannot change its value, while a variable can.

A variable is a fixed value, while a constant is a placeholder.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Define operators in C and give examples of different types.

Increment Operators: ++ (increment), -- (decrement)

Examples of different types of operators in C include: 1. Arithmetic Operators: + (addition), - (subtraction), * (multiplication), / (division), % (modulus). 2. Relational Operators: == (equal to), != (not equal to), > (greater than), < (less than), >= (greater than or equal to), <= (less than or equal to). 3. Logical Operators: && (logical AND), || (logical OR), ! (logical NOT). 4. Bitwise Operators: & (bitwise AND), | (bitwise OR), ^ (bitwise XOR), ~ (bitwise NOT), << (left shift), >> (right shift). 5. Assignment Operators: = (simple assignment), += (add and assign), -= (subtract and assign), *= (multiply and assign), /= (divide and assign).

Control Operators: if, switch, for

String Operators: + (concatenation), - (substring)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the order of precedence in C expressions?

Parentheses, Unary operators, Addition/Subtraction, Multiplication/Division/Modulus

Shift, Relational, Equality, Conditional, Assignment

The order of precedence in C expressions is: Parentheses, Unary operators, Multiplication/Division/Modulus, Addition/Subtraction, Shift, Relational, Equality, Bitwise AND, Bitwise XOR, Bitwise OR, Logical AND, Logical OR, Conditional, Assignment, Comma.

Logical AND, Logical OR, Bitwise OR, Bitwise XOR

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you evaluate an arithmetic expression in C?

Use arithmetic operators in an expression and evaluate it.

Use a loop to evaluate each number in the expression.

Use only comparison operators to evaluate the expression.

Write the expression in a string format and print it.

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