Logo/

Basic Programming Flashcards

Log in

Made with ScholarlyMake flashcards like these from your own notes

Basic Programming Flashcards

Questions and answers

13 cards
  1. Question:What is Lecture 2 about?

    Answer:Topics covered are variables and constants, basic data types, and operators.

  2. Question:What is computer memory?

    Answer:It includes RAM (Random Access Memory) and RAM segments such as code, data, heap, and stack segments.

  3. Question:What are the basic storage units used in computers?

    Answer:The basic storage units are bit and byte, where 1 byte equals 8 bits labeled with an address.

  4. Question:What are variables?

    Answer:Variables are named areas of computer memory used to store values with a scope of validity.

  5. Question:What are the rules for variable names?

    Answer:Variable names can include letters, digits, underscores, and the first character must be a letter or underscore, while excluding special characters like @, -, *, etc.

  6. Question:What is the scope of a variable?

    Answer:The scope of a variable refers to where its content can be accessed and manipulated.

  7. Question:What does a variable declaration statement define?

    Answer:It defines the name, type, and description of the variable.

  8. Question:Why is initial value set after declaring a variable?

    Answer:To avoid junk value.

  9. Question:How to change a variable?

    Answer:We use the assignment operation “=”.

  10. Question:What are the basic data types?

    Answer:The basic data types include int, float, double, char, and void.

  11. Question:What is an integer variable?

    Answer:An integer variable is any whole number without a decimal point.

  12. Question:How to print out integer variables?

    Answer:Using the printf() function and %d as integer conversion specification.

  13. Question:What are the ranges of integer variables?

    Answer:The ranges of integer variables are int: -2147483648 to 2147483647, unsigned int: 0 to 4294967295, signed int: -2147483648 to 2147483647, and short int.