Quick Kit: 18 flashcards

All 18 flashcards from this kit, free and with no sign-up.

1. What is a variable in C?

Show the answer

A named memory location that stores data of a specific type.

2. What are the four basic data types in C?

Show the answer

`int`, `float`, `char`, and `double`.

3. What is the difference between `=` and `==` in C?

Show the answer

`=` is the assignment operator, used to assign a value. `==` is the equality operator, used to compare two values.

4. What does the `break` statement do inside a loop?

Show the answer

It immediately exits the loop, regardless of the loop condition.

5. What is a function prototype in C?

Show the answer

A declaration of a function that tells the compiler its name, return type, and parameters before its full definition.

6. What is a pointer in C?

Show the answer

A variable that stores the memory address of another variable.

7. How is a string terminated in C?

Show the answer

With a null character (`\0`).

8. What is a structure (`struct`) in C?

Show the answer

A user-defined data type that groups variables of different data types under a single name.

9. What does the `continue` statement do in a loop?

Show the answer

It skips the rest of the current iteration and jumps to the next iteration of the loop.

10. What is the purpose of `malloc` in C?

Show the answer

It allocates a specified number of bytes of memory at runtime and returns a pointer to the allocated memory.

11. What is the difference between `while` and `do-while` loops?

Show the answer

A `while` loop checks the condition before executing the body; a `do-while` loop executes the body at least once before checking the condition.

12. What is the null character and how is it represented?

Show the answer

It is a character with ASCII value 0, represented as `\0`, used to terminate strings.

13. What does the address-of operator (`&`) do?

Show the answer

It returns the memory address of a variable.

14. What is recursion in C?

Show the answer

A function that calls itself to solve a smaller instance of the same problem.

15. What is the purpose of `fclose` in file handling?

Show the answer

It closes an opened file, flushing any buffered data and freeing system resources.

16. What is operator precedence?

Show the answer

The rules that determine the order in which operators in an expression are evaluated.

17. What is the difference between passing by value and passing by reference?

Show the answer

Passing by value sends a copy of the data; passing by reference (using pointers) sends the memory address, allowing the function to modify the original data.

18. What is the `switch` statement used for?

Show the answer

It is a control flow statement that selects one of many code blocks to execute based on the value of an expression.

Make your own

Your notes can be a kit like these

Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free, in 42 languages.

  • Chapter notes
  • Flashcards
  • Practice MCQs
  • Scored tests
  • Exam prep

Get Veda free See what students get

Free to start · No ads · Works in 42 languages