Unit-I (Introduction of C)
Unit-I (Introduction of C)
INTRODUCTION TO C
History of C
C language is developed by Mr. Dennis Ritchie in the year 1972 at bell laboratory at USA,
C is a simple and structure Oriented Programming Language.
In the year 1988 C programming language standardized by ANSI
(American national standard institute), that version is called ANSI-C.
In the year of 2000 C programming language standardized by ISO that version is called C-99.
All other programming languages were derived directly or indirectly from C programming concepts
.
Overview of C
C is a computer programming language developed in 1972 by Dennis M. Ritchie at the Bell
Laboratories
C is a simple and structure oriented programming language.
C is also called mother Language of all programming Language.
It is the most widely used computer programming language, this language is used for develop
system software and Operating System.
All other programming languages were derived directly or indirectly from C programming
concepts.
It is a robust language with rich set of built-in functions and operators that can be used to write
any complex program.
The C compiler combines the capabilities of an assembly language with features of a high-level
language.
Programs Written in C are efficient and fast. This is due to its variety of data type and
powerful operators.
It is many time faster than BASIC.
C is highly portable this means that programs once written can be run on another machines with little
or no modification.
Another important feature of C program, is its ability to extend itself.
A C program is basically a collection of functions that are supported by C library. We can also create
our own function and add it to C library.
C language is the most widely used language in operating systems and embedded system
development today.
SIMPLE C PROGRAM:
#include<stdio.h>
#include<conio.h>
void main()
{
printf(“WELCOME”);
Step 5: Output
WELCOME
Example:
#include<stdio.h>
#include<conio.h>
#include<math.h>
Definition Section
All the symbolic constants are written in definition section.
Macros are known as symbolic constants
Example:
#define PI3.14
#define TRUE1
There are some variables that are used in more than one function.
Such variables are called global variables and are declared in the global declaration section that is
outside of all the functions.
Example:
int total ;
1. Declaration part: The declaration part declares all the variables used in the executable part.
2. Executable part: Write the statement in the executable part, which wants to execute
These two parts must appear between the opening and closing braces.
The program execution begins at the opening brace and ends at the closing brace.
The closing brace of the main function is the logical end of the program.
All statements in the declaration and executable part end with a semicolon.
Subprogram section:
If the program is amulti-function programthen the subprogram section contains all theuser-
defined functionsthat are called in the main ()function.
User-defined functions are generally placed immediately after the main () function, although they may appear in
anyorder
#include<Stdio.h>
#include<conio.h>
Output: