Tuesday, January 17, 2012

Beginners C Programming : Variables & Data Types


The Journey Begins
I always thought to do something for the beginners, to make those lessons easier which gave me lots of pain. (:P) So, the journey begins from here. Actually, today I attended my first class of C++. The discussions will be on C++. But before that I would like to review some chapters for the beginners so that those terms became easy for them as well as for them also who are practicing C.

Why do we have to learn a programming language??
Simply, we came to learn about the computer because we love computer, that what I realized and also told by my favorite course teacher. And a programming language is a language to communicate with the computer. (hmm… In a simple line.)

What is C or Why C?
The C is called the mother of programming language, the root or base level language, developed by Dennis Ritchie (September 9, 1941 to October 12, 2011). For detail, take a tour to the Wikipedia.
C is one of the most widely used computer language. It is a procedural or step by step procedure language.

Please Note: Don’t panic. I don’t want to make it lengthy. Search the web if you want. I like to make it short as possible but more useful.

Okay, it’s time now! Let’s get into C!!
Before that, we must to be familiar with some definitions which are so much important.

Variable & Data Type:
This is the first thought of a programming language.

Variable:
We have used some variables in Math. We imagined some ‘x’ or ‘y’ to prove a problem. Finally the ‘x’ or ‘y’ had a value. Our variable is also like that. A variable is that, which can store a value. Finish!!!
Tips: Your variable should be any alphabet (uppercase or lowercase), any word (like ‘sum’), and any combination of alphabets (like ‘aa’). Do not use ‘space’ in your variable.

Data Type:
Now read attentively.
How many students are there in your section? Look carefully at them and you will find them their characteristics will not match with each other, even yours. Everyone have different personality. Isn’t it?
If the students are your variables then their personality or characteristics are their Data Type. Clear? I think No. Data Type of a variable is that which represents the type of the variable like ‘x’ is a integer number or real number or a character. This is important that your variable must contain a valid Data Type.

Some of the Data Types used in C are:
int (stands for integer numbers i.e like 3)
float (stands for real numbers i.e like 3.1416)
char (stands for character i.e like ‘a’)


Hope that it was easy for you to understand. You can mail me from my profile that is below Blog Archive.
Enjoy your stay on this blog.
ENJOY SAFE COMPUTING.
Thank you.

No comments:

Post a Comment

Thanks - Jajabor, 2014