In linux, use gcc to compile the C program-general Linux technology-Linux programming and kernel information. For details, refer to the following section. Void main ()
{Float x, y, z,;
Scanf ("% f, % f, % f", & x, & y, & z );
A = (x + y + z)/3;
Printf ("% f \ n", );
}
I saved the above program as: 1.c, and put it to the desktop. Then, I went to the desktop gcc-o 1. c under the terminal and executed it:
Jimoon @ jimoon-1 :~ /Desktop $ gcc-o 1 1.c
1. c: In the 'main' function:
1. c: 3: Warning: Implicit declaration of incompatible built-in function 'scanf'
1. c: 5: Warning: Implicit declaration of incompatible built-in function 'printf'
1. c: 2: Warning: The return type of 'main' is not 'int'
A file named "1" is displayed on the desktop.
Can you ask why? How to compile C Programs in linux
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service