Road to C surf

(This introductory tutorial cum article about a programming language is aimed towards to set a stage in the mind of new students, follower of computer software development process. Here you will get to know about what 'C' is, and how it can be useful for our career, or how it will contribute in our study/practice of art of programming.)

Introduction
----------------

'C'..sounds strange a bit, at first encounter for everyone, specially for Computer science students or similar group. It is neither a acronym or nor nick name to any standard thing, however, it is improvement over previous languages like BCPL and B.
Well buddies, I would like to assure you that it is not anything alien's stuff.. it is a human artifact constitute to simplified the job of developing softwares, which we are using or developing in general.

It was developed by great computer scientist mr. Dennis M. Ritchie in 1971 at 'AT & T Bell Labs,USA.' 'C' is a sole product of mr. Ritchie, in due course to develop an operating system named as 'UNIX' which later become popular among user due to its feature, bundled for first time in any operating system.

Let's talk about software in a nut shell- there is big array of Software scattered around us, for example most prominent software is our Microsoft Windows 7 operating system software or its family, more specifically its ancestors like MS windows 98, 2000, xp, vista or other softwares likemusic player, chat client, set top box (DTH TV service) etc.


Why Should Learn 'C'
-------------------------


Well buddies, there are a number of reason that can explore this point.. but most common reason that you can see and realize are as follows:

[] It is very easy language to learn, ....huh..it s not such easy..okay wait for some moments....cuz it is my turn to speak for this moment :) (i will explain it shortly why it is called easy...thanks for your consent!

[] It is helpful to develop logic of problem solving for programming or you can say to develop programming mind of one who wants to be software programmer/developer, web developer, database developer/administrator/manager, network programmer, games etc.


[] It provide good platform to learn newer concepts (Objects, Classes, Abstraction, Inheritance, Polymorphism etc.) wrapped up in newer language like C++/Java/C# etc.
[] One can develop essential softwares like Operating system, compilers, interpreter, commercial software etc. can write communication network application like software part of drivers, card etc.
[] Due to its low level features it is faster in execution, hence can be used to write drivers software.

[] It provide efficient memory management.
Why It is Easy to learn
----------------------------
Now, lets talk about why it is called easy to learn language while it has so many strange things.
.. so don't worry just read on.
[] It has concepts which are really easy to grasp because it uses Structure programming paradigm. that is a program is viewed in this way
-> Sequence
-> Decision making
-> Iteration or loop (repetitive task)
[] Just develop a road map of your problem to be solve in computer's environment. for instance if you want to print the roll number and name of students of your class.
-> Firstly you will make a table in which you will have 2 columns captioned as Rollno and Name.
-> You will ask the name of Student and his roll number.
-> Now will write his /her data into table
-> that is it.
The same job you have to do in your program with the provided programming language construct.
[] what you will do emulate same procedure in 'C'.
-> ask or prompt with printf() enter your name and rollno.
-> than scan or write in to table with the help of scanf() , this function will write data in to main memory only, but when you invoke with printf()the data will be displayed on computer screen as output.
[] Once, and just once the concept- how to use programming construct like, expressions, statements, operators, loops, array, structures, pointers, memory management, file handling etc., you grasp here will continuously help you for ever on each step of your career be it as software developer or be it web developer or be it any other kind of developer for computer and its related activity.
because.... each language same things or tools to develop programs with a little modification or slight changes in syntax to use them, however, Java is such programming language which doesn't use pointer and other concept of C to develop softwares.
____________________________________________________________________
* I hope, Now you can answer of your General queries, arose at first sight upon programming.
* In next blog we will take an over view on C++ and Java and after than we would start to learn the programming construct of each language.
* Well, my dear friends this blog-cum-article will be incomplete, if it still not able to remove your doubts over use programming language, if it is the case than please leave your Questions as comments, I ll do my best to solve them.
____________________________________________________________________

21 Sept. 2010
--------------- 
Ohh... i m really sorry I forget to give any example  for C. I hope you will not mind on the example that I m going to present here cause it is based on class 2 maths addition problem. which will let you to just understand the function of programming.,i.e. how we do it and how it looks. so it is as follows.


#include
/* this pair of /* */  is a comment and tells compiler that you can skip this part, go to next line of code where it gets end.*/
void main()
/* this is main () (function) it is an user define function where you write your main code of programming that instruct compiler what to do & when to do*/
{
/* this brace is called 'curly braces as you already know '{' this brace determine block of programming code is starting here, be it, a function or code of loop or anything which you want to combine. & its partner, i mean this symbol or character in programming '}' states code has finished.*/
int a , b, c;
/*a, b, & c are variable means it holds a place into memory, where we can store values for various operations. value may be any whole 2,34,1098, 0 or real number .23, .04 etc.*/
/* scanf() and printf() , what they do has already defined above */
printf("Enter two number to perform addition-");
printf("\n Enter first number:-");
scanf("%d",&a);

/* what ever line of text, you want to display on out-
put screen(known as string typically, are placed between " " in when you use printf(). and the '%d' that you can observe below in scanf() and in printf() as well, are known as format string, which determines that it will going to denote integer type value('int' data type) whether it is used during printf() or scanf() and the '&' symbol which we generally known as "and" should be identify as Ampersand character but not as "and", used here to denote any location in memory which a compiler assign to your variable(s). Value of your variable will be store at these locations denoted by & (ampersand) in main memory or generally known as RAM.
 */

printf("\n Enter second number:-");

scanf("%d",&b);
c = a+b;

/* '+' ..well done! it is addition symbol. but Programmer called this Addition operator, it is clear that it is going to perform/operate addition work of two values. In programming you can categorize operators into 7 category. which we will learn sooner*/


printf("\n Sum or output is : %d",c);
printf("Thanks");

/* one last but not the least, but very important thing, ";" this semicolon that you can observe after each blue line, known as statements in programming, signifies that this specific line of code has complete. and better knows as "terminator" (well you can resemble this with the popular movie 'The Terminator' of Arnold schwarznegor. :) )
*/

}
 well one more thing that you must use any IDE (integrated development environment) that you can easily get by a mere googling on the keywords "Turbo C compiler or C compiler". Where you just need to give combination of commands to compile and execute and then, to watch the output, after very hard job of coding...humfff. :)
it would be better to eat the apple, that i just have created for you and observe the taste, if you find something awkward than come back here without any hesitation. you'r welcome. :)
ok'z..all the best and have very good time. :)

2 comments:

  1. well in the first line of code.. somehow has omitted,(/* #include */).. please mind this change, if you didn't know anything about programming, or about 'C' programming language.
    -Thank you!

    ReplyDelete
  2. please remove the spaces and join the outcome afterward #include. it is as S T D I O . H , put into angular brackets that is '<' --- '>' and write this group of text in small caps too. i figured out that the text editor of this blogger platform doesn't accept such intrinsic code or treating as comment of web programming.

    ReplyDelete

Search This Blog

Let make your friend aware about this post