






































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







































C statements/comments
To be able to complete a task, program needs to have the ability to store its data Program’s data is stored in computer’s memory Computer Memory stores data in a sequence of bits (each bit can either store 0 or 1) Even though the smallest unit is a bit, smallest usable unit in memory is a byte Each byte (8 bits) in the memory has an unique location (its counting index)
Variable^ Variable Data^ Data Variable is used to store data
VariableVariable
Data^ Data
Variable is used to store data “Variable” means it could store different data at different time
Data^ Data
variable Data Data Data
Basic data types
E.g., 1, 2, 3, etc.^ E.g., 1, 2, 3, etc.^ Size: 4 bytes^ Size: 4 bytesint^ int E.g., 1.1, 1.2, etc.^ E.g., 1.1, 1.2, etc.^ Size: 4 bytes^ Size: 4 bytesfloat^ float^ E.g., 1.234, 2.3,^ E.g., 1.234, 2.3,^ Size: 8 bytes^ Size: 8 bytesdouble^ double etc. etc.
E.g., ‘a’, ‘b, ‘c’,^ E.g., ‘a’, ‘b, ‘c’,^ Size: 1 byte^ Size: 1 bytechar^ char etc. etc.^ Usage: datatype varName;^ E.g., E.g., with initialization int x = 10;^ int^ x; void^ void