You are on page 1of 5

Features of C

1. High level language

2.Small language having 32 keywords

3. Core language as many languages are dependent on ‘C’


4. Portable
5. Built-in functions and operators
6. Structural language (Modular programming)
7. Pointers
8. Extensible language
9. Compilation and execution is faster
10. Dynamic memory allocation
11. Embedded systems
12. Platform dependent
Structure of 'C' program

1. Documentation section
// - Single line comment
/*-----*/ - Multiple line comment
2. Link section
include 'header files' by using #
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<string.h>
3. Definition section
Defines all symbolic constants
#define PI 3.14 - - Macro definition
4. Global declaration section
int a; -- Global declaration
sum()
{
int a; -- Local declaration
}
5. Main section
Only one main section
void main()
{

}
6. Sub program section
Use all user defined functions
#include<stdio.h>
#include<conio.h>
void main()
{
printf("Hello World");
getch();
}
//C Program for Addition of Two Numbers (Simple Way)
#include<stdio.h>
void main(){
//Declaring three Variables
int x, y, sum;

//Input Numbers
printf("Enter Two Numbers : \n");
scanf("%d %d",&x, &y);

//Calculating Sum of Two numbers


sum = x + y ;
//Desplaying Sum
printf("Sum is : %d", sum);
}

#include<stdio.h>
void main()
{float r,aoc;printf("Enter the radius : ");scanf("%f",&r);
aoc=3.14*(r*r);
printf("area of circle is : %f",aoc);
}

#include<stdio.h>#define pi 3.14void areaofCircle(float r){

float aoc;

aoc=pi*(r*r);

printf("area of circle is : %f",aoc);

}void main(){float r;printf("Enter the radius : ");scanf("%f",&r);

areaofCircle(r);}

Outpu

You might also like