Basics of C language
C language is the most commonly used programming language. C language is invened by Dennis Ritchie. It is used in wide range of aaplications. Before C language there ware Assembly level language and Basic compiling programming language(BCPL). Assembly level language code is leanthy as compared to C language code, therefore C language is preffered over BCPL and Assembly level language.Basic Structure of C language
Documentation Section
Link Section
Defination Section
Global Declaration Section
Main function Section
Subprogram Section
C program always starts with a include file. SYNTAX : #include filename where filename may be stdio.h, conio.h, math.h, string.h, etc. depending upon the operation to be performed in the program. Most commonly used is stdio.h, which stands for standard input output header file. math.h is used to perform mathematical operations in the program, similarly other header files are used to perform specific program in the program.
Mainly C language consists of function. Anything in C language which is followed by pair of parenthesis '()' is called as function. Ex. printf(____), scanf(____). main function starts with opening curly braces'{' and ends with closing curly braces'}'. These opening and closing curly braces is known as a block. And anything writter inside these block is called as function defination.
main() //main function { //opening of block statement; //function defination } //closing of block.
Simple program in C language.
//Program to print Hello World. #include <stdio.h> int main() { printf("Hello World."); return 0; }
Output : Hello World.
If you want to learn more in C subricribe to these blog.
Comments
Post a Comment