My Sponsors

Tuesday, February 1, 2011

C/C++ Programming

This blog is created to help students to learn on the basics of C/C++ programming language. I include several simple modules such as:
I. Variable Declaration ex: a = 5; x =6; etc
II. Control Structures. ex: if, if else, switch, for, while, do-while etc. 
III. Arrays ex: a []; a[5]; a[]={1,2,3,4,5};.
III. Functions and Programmer's Defined  Function.

So, Lets begin with Variable Declaration.


As you can see, I have an example declaration above: a = 5; 

What does each stands for? for a, this is our variable name.
What is a variable name? It is a given name for your data in your program. (To see the standard meaning, just refer to any C/C++ programming books).But you cannot declaration any variable names as you want. It has also a limitation in naming a variable. Example: you cannot declare a variable name with numbers, predefined keywords in C/C++ like cout, cin, void,  etc. it should start with letters. if you need to put numbers, you may but dont give a space between them. ex: a4 =5. NOT a 4=5. But you can put underscore "_" between them. ex: a_4 = 5.

Now we have a variable name a. I'm sure you know already the concept.