Introduction to C | A sample of C language program

Prologue to C 

An example of C language program 

Case of C program to figure zone of circle: 


Clarification of above program : 

# is the preprocessor mandate which directions that the substance of record ought to be incorporated at the season of aggregation. 

< stdio.h> is the header document which contains all information and yield capacities like scanf(), printf() which are as often as possible utilized in c programs. 

principle() is the main capacity which is executed by a C program. 

1. int a,r=5; - > This announcement pronounces 2 factors an and r of sort number and r has been relegated an estimation of 5. 

2. const pi=3.14; - > This announcement pronounces pi as steady and worth 3.14 has been relegated to it. 

3. a = pi * r *r; - > This announcement processes the zone of circle and allocate it to variable a 

4. printf("%f",a); - > This announcement prints the region of circle utilizing printf work. 

5. getch(); - > It is utilized to get character from client. 

Note:/* Any thing composed inside it is consider as remark proclamations. */

No comments

Powered by Blogger.