【发布时间】:2019-08-18 09:04:33
【问题描述】:
return(0) 在 C 语言中有什么用?我编写了不使用它就可以正常工作的程序。请用简单的方式向我解释一下,因为我是 C 的初学者。如果答案很复杂,可能会让我更加困惑......
#include <stdio.h>
#include <stdlib.h>
int main()
{
float km, meter, feet, inch, cm;
printf("Enter the distance(must be in km: \n");
scanf("%f", &km);
cm = 100000*km;
inch = 39370.1*km;
meter = 1000*km;
printf("The distance between the cities in cm is %f \n", cm);
printf("The distance between the cities in inches is %f \n", inch);
printf("The distance between the cities in meters is %f \n", meter);
}
【问题讨论】:
-
它只是一个退出代码
-
@Mox 那是What should main() return in C and C++的副本...
标签: c