Beginning of a C program
A C program starts with its structure, that some people have problem in understanding the basic structure, but after some time it is easily understood that the first in its basic structure is the header file which defines that it Where the code is being saved, then there is the main function from which the programming starts in which we write the code and take its return value and the code gets executed.
Header Files Inclusion
stddef.h – Defines several useful types and macros.
stdint.h – Defines exact width integer types.
stdio.h – Defines core input and output functions
stdlib.h – Defines numeric conversion functions, pseudo-random network generator, memory allocation
string.h – Defines string handling functions
math.h – Defines common mathematical functions
Main Method Declaration
What is the main function that declares the syntax of the program and from this the programming starts.
int main()
{}
Variable Declaration
After that we define the variables, we use these variables to store data in the program, whatever value we keep in these variables according to their property, we can use it at the time of writing the code.
int main()
{
int a;
here are different type of variable we can use "int , float, char, double, etc,"
Body
The body of a function in the C program, refers to the operations that are performed in the functions. It can be anything like manipulations, searching, sorting, printing, etc.
int main()
{
int a;
printf("%d", a);
.
.
Return Statement
The last part of any C program is the return statement. The return statement refers to the returning of the values from a function. This return statement and return value depend upon the return type of the function. For example, if the return type is void, then there will be no return statement. In any other case, there will be a return statement and the return value will be of the type of the specified return type.
int main()
{
int a;
printf("%d", a);
return 0;
}
First c program
#include
int main( )
{
printf("Hello World");
return 0;
}
first post of C programming.-> link