Monday, August 4, 2008

STRUCTURE OF C

In todays session we are going to learn about a structure of 'C' that is how a c program can be written.In this we will deal with how to write our first 'C' program.
Lets start

structure of 'C' program looks like this

# include
void main()
{
some code
}


this is the structure of a 'C' program.lets learn about each of these statements

#include

Every 'C' program starts with this statement.we call this statement as preprocessor directive
in this statement # include is a preprocessor directive which is a directive given to a compiler or processor. is a header file which includes all functions related to the input/output operations.std stands for standard and io for input/output.

Altogether # include means a preprocessor directive given to a compiler to include the content of stdio.h header file in to our program.

next statement is void main()

this is a point at which our 'C' program execution starts,we call this a main function which will begin our 'C' program execution.We will discuss about void keyword in later session.

{ ---------->starting of a program
some code
} ---------->end of the program

{ } we call it as block binders which are used to hold the block of statements which indicate start and end of program or block.


Lets begin with our first program

# include
void main()
{
printf("welcome to c world");
}

note:remember that all statements in c program are terminated with a semicolon ; except few.

In this program we are a printf function which is used to print some thing on to the screen or console we can say.

Now that we have written our code which is called as source code but it is not understandable by the machine.Machine can only understand machine language(byte code),so after writing a code our next task will be to convert our source code in to the byte code to do that press Alt+F9
now a object code is created,next we need to execute the program for that ,press Ctr+F9,After this step executable file is created now we can run our program.To view the output press Alt+F5

In the next session we will discuss about C tokens.

Wednesday, July 30, 2008

C MATERIAL MUST FOR FRESHERS WHO ARE IN SEARCH OF IT JOB

This is a blog exclusively created for freshers who are in search of their dream IT job.and we are here to guide freshers to get their dream job.
One of the most important point to be noted is to prepare yourself before you start job trials,concentrate on basic IT skills(technical), aptitude and verbal skills.
And we are here to guide you through out the technical that is Information Technology skills.as a fresher you are expected to have a basic knowledge of 'C' language at least.so,through out this blog,we will try to make you proficient in C language.we will explain each and every concept step by step,so that a fresher can understand very easily.we will update this blog daily, don't forget to check it up.today i am going to start C language

HISTORY OF C LANGUAGE

Our first will be history of C in which we are going to learn how ‘C’ language came in to existence.
Before 1960,many languages came in to existence but to develop one type of application we need to use one type of language for example if we want to develop a application we need to use a language specific to that application.so some people thought that there should be a language which can be used to develop any type of application,so CPL-combined programming language was invented,it is used to develop any type of application but to perform small task we need to write bulks of code ,so a shorter version of CPL was invented which is known as basic combined programming language

BCPL (Basic Combined Programming Language) is a computer programming language designed by Martin Richards of the University of Cambridge in 1966.
Originally intended for writing compilers for other languages
BCPL was a response to difficulties with its predecessor CPL
Richards created BCPL by "removing those features of the full language which make compilation difficult"

B is a programming language that was developed at Bell Labs.B was greatly influenced by BCPL, and its name is most likely to be a contraction of BCPL.It was developed Kenthompson.B language is mainly used for system programming

Next C language came in to existence

In computing, c is a general-purpose, block structured, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone laboratories for use with the Unix Operating System.it is widely used on a great many different software platforms and computer architectures, and several popular compilers exist. C has greatly influenced many other popular programming languages

After C language came in to existence it has become so popular that UNIX operating system was rewritten in C language.

NOW YOU GOT THE IDEA ABOUT HOW 'C' LANGUAGE CAME IN TO EXISTENCE,IN THE NEXT POST WE WILL DEAL WITH THE STRUCTURE OF 'C' PROGRAM IN WHICH WE WILL DEAL WITH HOW TO WRITE 'C' PROGRAM.