Professional Documents
Culture Documents
Ses6 BasicC PDF
Ses6 BasicC PDF
Ses6 BasicC PDF
Session 6: Basic C
Iván Amaya
CONTENTS
VARIABLES
EXAMPLES
FURTHER READING
COMPUTER PROGRAMMING – SESSION 6 IVÁN MAURICIO AMAYA CONTRERAS 2
VARIABLES
A variable is a space in memory for storing values
Valid identifiers (i.e. names) contain letters, digits and underscores (i.e. ‘_’)
Identifiers are case sensitive (i.e. var != Var != vAr != vaR != VAR)
Identifiers should begin by lowercase letter (e.g. age and not Age)
Local variables are known only to the function they are declared in
This means you can have a global var and a local var
COMPUTER PROGRAMMING – SESSION 6 IVÁN MAURICIO AMAYA CONTRERAS 6
READING DATA FROM USER
scanf(format, &variable_name)
Included in stdio.h