780 likes | 925 Views
Programming Languages. Programming language: A set of rules, symbols and special words.syntax tells which statements are legal or acceptedsemantics determine meanings of instructions. Basic Elements of C . A C Program (or any program in a procedural programming language)Collection of 1 or more
E N D
1. CSci 152: Programming IIFall 2004 Review
2. Programming Languages Programming language: A set of rules, symbols and special words.
syntax tells which statements are legal or accepted
semantics determine meanings of instructions
3. Basic Elements of C++ A C++ Program (or any program in a procedural programming language)
Collection of 1 or more subprograms called functions
Which is a collection of statements that can accomplish something useful
sequence, selection, repetition
Special function called main
4. Hello World! #include <iostream>
using namespace std;
int main()
{
cout << “Welcome to C++ Programming.” << endl;
return 0;
}
5. C++ Tokens Special Symbols
+ - * / . ; ? , <= != == >=
Word Symbols
int, float, char, void, return
Identifiers
Identifiers are names of things that appear in programs, such as variables, constants, and functions.
Some are predefined others are defined by you, the programmer.
6. C++ Data Types def Data type: A set of values together with a set of operations simple data type structure data type pointers