Saturday, February 18, 2012

Introduction to C-Language

Before we can begin to write serious programs in C, it would be interesting to find out what really is C, how it came into existence and how does it compare with other computer languages.
C is a programming language developed at AT & T’s Bell Laboratories of USA in 1972. It was designed and written by a man named Dennis Ritchie

Possibly why C seems so popular is because it is reliable, simple and easy to use. Moreover, in an industry where newer languages, tools and technologies emerge and vanish day in and day out, a language that has survived for more than 3 decades has to be really good.
First C Program:
#include<Stdio.h>
main()
{
printf(“Welcome to C Programm”);
}

main( ) is a collective name given to a set of statements. Technically speaking main( ) is a function. Every function has a pair of parentheses ( ) associated with it. One such function is printf( ). We have used it display on the screen “hello word”.
Steps for compilation and execution of C-Program:
Assuming that you are using a Turbo C or Turbo C++ compiler here are the steps that you need to follow to compile and execute your first C program…
(a) Start the compiler at C> prompt. The compiler (TC.EXE is usually present in C:\TC\BIN directory).
(b) Select New from the File menu.
(c) Type the program.
(d) Save the program using F2 under a proper name (say Program1.c).
(e) Use Ctrl + F9 to compile and execute the program.
(f) Use Alt + F5 to view the output.
Note that on compiling the program its machine language equivalent is stored as an EXE file (Program1.EXE) on the disk. This file is called an executable file.



"ITS JUST START"

No comments:

Post a Comment