C Language Day

Simple C language program:

Code:

1 #include<stdio.h>
2 int main()
3 {
4     printf("This is a first C program.\n");
5     printf("This is second line");
6     Return 0;
7 }

operation result:

This is a first C program.

This is second line

-----------------------------------------------------------------------------------

The first line "#include <stdio.h>", header files, i.e., below the code will call a function (for class) libraries (method supported by this library)

The second line "int main ()", the main function, the default position of all the program initiates execution, the main function of the C language type return int (integer type), C # main function return type is string (string type)

Fourth row "printf (" This is a first C program \ n. ");", "Printf" function output, "\ n-" newline ";" statement indicating the end

The fifth line "Return 0;", returns an integer of 0 before the main function is finished, return type determined by the type of characters before the function name, for example "int main () {}", returns an integer type, "string str () {}" returns the string type

------------------------------------------------------------------------------------

Bookmark: "C Programming Language", Fourth Edition, Hemopurification, P6

Guess you like

Origin www.cnblogs.com/start-from-scratch/p/11836062.html