欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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