Basic introduction to C

C introduction

C is a general-purpose high-level language. It was developed by Dennis Ritchie at Bell labs in the year of 1970 but popularly from 1972. C language is the most popular language and simple language. C was invented to write an operating system called UNIX.

Where is C used? 

C language is used in wide range of applications, few of them are given below:


1.    Embedded systems.
2.    Developing system applications.
3.    Developing desktop applications.
4.    Developing browsers and their extensions. 
5.    Used to develop databases. 
6.    Developing an operating system. 
7.    Compiler production.
8.    Internet of Things (IOT)applications.
Rules for writing the C-program

1.Usually all the programming statements must be written in lower case letters.
2.Every program execution starts with main function.
3.All the programming statements must be written in between open and closed curly braces {}.
4.List of same variables of same type should be separated by a comma (,).
Eg: int a,b,c;
5.Statement should end with semicolon(;).
6.Every function should be followed by couple parenthesis [ ( ) ]
Eg: clrscr() , printf() , scanf() etc.,
7.While comparing or assigning a character, the character should be taken in single quotation marks ( ' )
8.While comparing or assigning a string, the string should be in double quotation marks ( '' )
9.The comments must be taken in between /*   */

Structure of C programming

/* comment section*/
File inclusion
Pre-processor directions
Global declaration
main()
{
[local variables];
statements;
...............
.............
.............
}
[return type] <method name>
{
[local variables];
statements;
...............
.............
[return<value(variable/ expression)]
}

No comments:

Post a Comment