Lecture 4
Lecture 4
Lecture 4
• Introduction To Computing
By Iqra Tahir
Programming
Program Programming
• A computer program, or a program, is a sequence • Programming is a process of planning and creating
of statements whose objective is to accomplish a a program
task.
• C++ tokens are divided into special symbols, word symbols, and identifiers. Following are some of the special
symbols:
• The first row includes mathematical symbols for addition, subtraction, multiplication, and division.
• The second row consists of punctuation marks taken from English grammar.
• Note that the comma is also a special symbol. In C++, commas are used to separate items in a list.
Semicolons are also special symbols and are used to end a C++ statement.
• The third row consists of tokens made up of two characters that are regarded as a single symbol. No
character can come between the two characters in the token, not even a blank.
Reserved Words (Keywords)
• A second category of tokens is reserved word symbols.
• Some of the reserved word symbols include the following: int, float, double, char, const, void, return
Identifiers
• Third category of tokens
• Consists of letters, underscore, and characters (_) and must begin with an underscore or letter
int main()
{
cout << "Size of char : " << sizeof(char) << endl;
cout << "Size of int : " << sizeof(int) << endl;
return 0;
}
Output
Size of char : 1
Size of int : 4
Size of long : 8
Size of float : 4
Size of double : 8