3.1 == 請同學練習找出下列程式錯誤之處並修正
#define PI 3.1415926
int main( void ) {
/* [a] : Print pi with default floating point output */
printf("My First Program : PI = %f \n, PI" );
/* [b] : Now experiment with conversion specifications */
printf("My First Program : PI = %14.7f \n", PI );
printf("My First Program : PI = %14.7e \n", PI );
printf("My First Program : PI = %14.7E \n", PI );
printf("My First Program : PI = %14.7g \n", PI );
printf("My First Program : PI = %14.7G \n", PI );
printf("My First Program : PI = %-14.7f \n", PI );
printf("My First Program : PI = %-14.7e \n", PI );
}
0 Comments:
張貼留言
<< Home