Here is the basic syntax of C,it’s a program to Print Hello.
#include <stdio.h>
int main()
{
printf("Hello");
return 0;
}
Output : Hello
Header Files Inclusion: The first and foremost component is the inclusion of the Header files in a C program.
A header file is a file with extension .h which contains C function declarations and macro definitions to be shared between several source files.
#include<header_name.h>
it’s contain the necessary file for the program.
#include<stdio.h>
#include<math.h>
Main Function Declaration: The next part of a C program is to declare the main() function.this is the Main Function, it will execute first in program.
The syntax to declare the main function is:
int main()
{
return 0;
}
Body: Body of a function in C program, refers to the operations that are performed in the functions. It can be anything like manipulations, searching, sorting, printing, etc.
Simply the space in which we are going to write our Program.
int main()
{
<body>
return 0;
}
Return: 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.
<return_type> main ()
#include<stdio.h>
int main()
{
return 0;
}
#include<conio.h>
#include<stdio.h>
void main()
{
getch();
}
in the
so overall
1st line #include<stdio.h> is including the file stdio.h to our program
2nd line is including the conio.h file to our program
3rd & 4 rth line starting of the main function
5th line print(“HEllo wORLD”); is a printing statement that will print whatever is written in-between ” ” , to the screen
6th line closing of the main function with its return type if int main then return 0; and if void then we have to use getch() for showing outputs.
Roxie
4 years agoHi, very nice website, cheers!
——————————————————
Need cheap and reliable hosting? Our shared plans start at $10 for an year and VPS plans for $6/Mo.
——————————————————
Check here: https://www.reliable-webhosting.com/