Structure of C Programming Language
Structure of c program
will explain the step of c program in many step a program will developed so
there are the step:-
- Comment Line
- Header file declaration
- Main function
- Opening barse
- Body of program
- Closing barse
·
/* Comments */
Comments
are a way of explaining what makes a program. The compiler ignores comments and
used by others to understand the code.
·
#include<stdio.h>
stdio
is standard for input/output, this allows us to use some commands which includes
a file called stdio.h. Or This is a preprocessor command. That notifies the
compiler to include the header file stdio.h in the program before compiling the
source-code.
·
int/void main()
int/void
is a return value, which will be explained in a while.
·
main()
The
main() is the main function where program execution begins. Every C program
must contain only one main function. Or This is the main function, which is the
default entry point for every C program and the void in front of it indicates
that it does not return a value.
·
Braces
Two
curly brackets "{...}" are used to group all statements. Or Curly
braces which shows how much the main() function has its scope.
·
printf()
It
is a function in C, which prints text on the screen. OrThis is another
pre-defined function of C which is used to be displayed text string in the
screen.
Example:
/*
write a program to print hello */
#include<stdio.h>
#include<conio.h>
Void
main()
{
printf(“hello
sir welcome to today class of c”);
getch();
}
Output:
Hello
sir welcome to today class of c
No comments:
Post a Comment