Showing posts with label Introduction. Show all posts
Showing posts with label Introduction. Show all posts

Tuesday, January 4, 2011

Why we bother to learn C ?

C seems so popular because it is simple, reliable, easy to use and easy to learn ( as compare to learn Java directly) general purpose language. There are several reason behind choosing C as first programming language.

  • Before migrating to C++, C# or Java it is necessary to understand the pattern of any programming language thoroughly. By comprehending basic element of any programming language like structure of a program, control statements(if, else, else if, switch statements), expressions, looping statements( while, do while, for).

  • Dennis Ritchie developed C for developing operating system(UNIX) for PDP-11 machine. Kernel was completely written in C. Major parts of popular Operating Systems like Linux, Unix, Mac and Windows are still written in C.

  • It is a machine independent language. It means a program written for any machine can also be executed on another machine and programs written in C can be executed almost on every Operating System.

  • Electronics gadgets like Cell Phones, palmtop, i phones, i-pods, Notebooks etc.) have become rage of today. It seems that life without these gadgets will become dull and boring. Youngsters can not imagine their life without these gadgets. What makes these devices intelligent and smart?.  Off-course because of OS and programs or apps embedded in these devices. Program written in C run fast and efficiently that's why C is always preferred to write programs for these devices.

  • Gaming industry in emerging rapidly. 2D or 3D games requires a lot of memory and processing power. If you had played any game you might  be notice that Player(you) navigates some objects like bikes,cars, weapons etc. And speed plays an important role in gaming. As earlier mentioned programs written in run fast Gaming Frameworks have developed using C. Therefore  developers and programmers./

Sunday, January 2, 2011

First Program "hello world"

Here is the first program from which you can start your programming as i did. C is a general purpose programming language developed by Dennis Ritchie at Bell Laboratories(1972).
C is the one of the most popular language of all the time. C is  influenced by B, BCPL, CPL, ALGOL, Assembly, FORTRAN, PL/I and it has influenced many languages like C++, C--, C#, Objective C, BitC, D, Java, JavaScript, PHP, Perl, Pike , LPC and Python etc.
Look at the program below and try to understand it.



/*  Name: hello world
Author: Parveen Malik,,
Date: 02/01/11 15:11      // comment section
*/


#include<stdio.h> // header section
#include<conio.h>


void main() //program starts from here
{
printf("hello world"); // Prints the "hello world" on console screen

getch();

} //exit





[caption id="attachment_8" align="aligncenter" width="662" caption="OUTPUT"]First Program "hello world"[/caption]