C语言的引用传递方法
程序员文章站
2022-06-24 20:03:58
#include
#include
int main(int argc, const char * argv[]){
double pi = 3.14;
double in...
#include
#include
int main(int argc, const char * argv[]){
double pi = 3.14;
double intgerPart;
double fractionPart;
fractionPart = modf(pi, &intgerPart);
printf("Pi's Interger Part is %.0f, and Pi's fraction part is %.2f \n", intgerPart, fractionPart);
return 0;
}
Result:
Pi's Interger Part is 3, and Pi's fraction part is 0.14
Program ended with exit code: 0