Tuesday, September 24, 2013

C Programming

  C is a general-purpose programming language initially developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs.
  C is one of the most widely used programming languages of all time, and C compilers are available for the majority of available computer architectures and operating systems.
  Many later languages have borrowed directly or indirectly from C, including C#, D, Go, Rust, Java, JavaScript, Limbo, LPC, Objective-C, Perl, PHP, Python, Verilog (hardware description language) and Unix's C shell.


Basic Structure of a C Program is as follows [in order]  :
1.Pre-processor Directives / Header-Files
2.Global-variables
3.Main Function[with-in the main is the local variable declaration and other instructions]
4.Other User defined functions

Note : Every program in C starts executing from the first instruction in the main() and ends with the last instruction in the main().
C Compiles which may be used to compile C programs are : Turbo C, GCC, Dev C, Visual C, Code Blocks ,etc.
Various compilers have minor changes in the compiler-specific commands' syntax[i.e. commands which can be interpreted only by specific compilers like clrscr() to clear screen in Turbo C].

Example C Program :

/* Hello World program */  #include<stdio.h>
  int main()
  {
      printf("Hello World");
      return 0;
  }
next..

No comments:

Post a Comment