Introduction to C Programming
C is a general-purpose, procedural computer programming language supporting structured programming.
C was originally developed at Bell Labs by Dennis Ritchie between 1972.
During the 1980s, C gradually gained popularity. It has become one of the most widely used programming languages.
C has been standardized by the ANSI since 1989 (ANSI C) and by the International Organization for Standardization (ISO).
Features of C
The Following features of C are as follows:-
Procedural Language.
Fast and Efficient.
Modularity.
Statically Type.
General Purpose Language.
Rich set of built-in Operators.
Libraries with rich Functions.
Middle-Level Language.
Simple.
Machine Independent.
Basic Structure of a C Program
A Normal C program consists of the following parts:-
# include <stdio.h> – This command is a preprocessor directive in C that includes all standard input-output files before compiling any C program so as to make use of all those functions in our C program.
int main() – This is the line from where the execution of the program starts. The main() function starts the execution of any C program.
{ (Opening bracket) – This indicates the beginning of any function in the program (Here it indicates the beginning of the main function).
/* some comments */ – Whatever is inside /*——-*/ are not compiled and executed; they are only written for user understanding or for making the program interactive by inserting a comment line. These are known as multiline comments. Single line comments are represented with the help of 2 forward slashes “//——”.
getch() – This command helps to hold the screen.
return 0 –This command terminates the C program and returns a null value, that is, 0.
} (Closing brackets)- This indicates the end of the function. (Here it indicates the end of the main function)
Example Program:
#include<stdio.h>
Int main()
{
printf(“Hello Everyone”);
return 0;
}
0 Comments
Please do not enter any spam link in the comment box