Lets start with our first c program example
Here is a simple c program which prints a simple "Hello world" message on the console.
You might be thinking what is that #include , stdio.h, main ,printf , return 0 for. SO.......
Lets have a look at the code.
Here is a simple c program which prints a simple "Hello world" message on the console.
- #include<stdio.h>
- int main()
- {
- printf("Hello world \n");
- return 0;
- }
You might be thinking what is that #include , stdio.h, main ,printf , return 0 for. SO.......
Lets have a look at the code.
- #include
- stdio.h
- int main()
"int " is a Data type which refers to integer values. "main( )" is a function which is necessary in order to run any particular program. We'll come to functions and data types in later sections. Just remember that "int main( )" is a initial function which is required for any program to run and int defines the return type of that "main function". "main" function is the first function to be executed in any program.
- printf("hello");
- return 0
- { } (curly braces), ; (semicolon)
No comments:
Post a Comment