Detail post of C Programming | How to write a basic c program? | Execute C program.
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.
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.
here are different type of variable we can use "int , float, char, double, etc,"
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.
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.
First c program
int main( )
Thank You for supporting this post..............
Posted with STEMGeeks