Made with ScholarlyMake flashcards like these from your own notes
Question:What is Lecture 2 about?
Answer:Topics covered are variables and constants, basic data types, and operators.
Question:What is computer memory?
Answer:It includes RAM (Random Access Memory) and RAM segments such as code, data, heap, and stack segments.
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.
Question:What are variables?
Answer:Variables are named areas of computer memory used to store values with a scope of validity.
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.
Question:What is the scope of a variable?
Answer:The scope of a variable refers to where its content can be accessed and manipulated.
Question:What does a variable declaration statement define?
Answer:It defines the name, type, and description of the variable.
Question:Why is initial value set after declaring a variable?
Answer:To avoid junk value.
Question:How to change a variable?
Answer:We use the assignment operation “=”.
Question:What are the basic data types?
Answer:The basic data types include int, float, double, char, and void.
Question:What is an integer variable?
Answer:An integer variable is any whole number without a decimal point.
Question:How to print out integer variables?
Answer:Using the printf() function and %d as integer conversion specification.
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.