C語言 - 考試
By Jack
at 2019-05-25T22:20
at 2019-05-25T22:20
Table of Contents
https://imgur.com/a/z03wN6H
如題比較%f與%lf的不同
但我輸入的數字
輸出皆為0
不知那裡打錯了
請大大指正~
DEV-C++
/*比較%f與%lf的輸出不同*/
#include<stdio.h>
#include<stdlib.h>
int main()
{
double num;
printf("請輸入倍準確浮點數: ");
printf("%f",&num);
scanf("您輸入的數以%f的型態印出為%f\n",num);
scanf("您輸入的數以%lf的型態印出為%lf\n",num);
system("pause");
return 0;
}
--
如題比較%f與%lf的不同
但我輸入的數字
輸出皆為0
不知那裡打錯了
請大大指正~
DEV-C++
/*比較%f與%lf的輸出不同*/
#include<stdio.h>
#include<stdlib.h>
int main()
{
double num;
printf("請輸入倍準確浮點數: ");
printf("%f",&num);
scanf("您輸入的數以%f的型態印出為%f\n",num);
scanf("您輸入的數以%lf的型態印出為%lf\n",num);
system("pause");
return 0;
}
--
Tags:
考試
All Comments
By Hedda
at 2019-05-30T12:30
at 2019-05-30T12:30
By Madame
at 2019-06-02T12:00
at 2019-06-02T12:00
By Puput
at 2019-06-05T04:16
at 2019-06-05T04:16
By Megan
at 2019-06-08T09:07
at 2019-06-08T09:07
By Jessica
at 2019-06-12T21:44
at 2019-06-12T21:44
By James
at 2019-06-13T23:42
at 2019-06-13T23:42
By Tom
at 2019-06-18T10:50
at 2019-06-18T10:50
Related Posts
有人掉了鉛筆盒嗎?
By Adele
at 2019-05-25T18:42
at 2019-05-25T18:42
慈濟
By Gary
at 2019-05-25T18:20
at 2019-05-25T18:20
AICPA通過心得
By Delia
at 2019-05-25T15:37
at 2019-05-25T15:37
﹝講座﹞美國會計師證照說明會
By Enid
at 2019-05-25T09:44
at 2019-05-25T09:44
刑法的幾個問題
By Hedda
at 2019-05-25T07:47
at 2019-05-25T07:47