First Program in C

First Program in C

First Program in C

 Structure of Program


Sample Code of Print 'Hello World' in screen

                    #include<stdio.h>
                    
                    int main()
                    {
                        printf("Hello World");
                        return 0;
                     }

Detail Description about program:

#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.

BracesTwo 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.

or

This is another pre-defined function of C which is used to be displayed text string in the screen.

return 0At the end of the main function returns value 0.





Previous                                                                                       Next


0 Response to "First Program in C"

Post a Comment

Iklan Tengah Artikel 1

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel