Startled by the sudden sound,Sally shouted,"By the Great Pumpkin,what was that!"code
#include<stdio.h> int main() { printf("\a"); printf("Startled by the sudden sound,\n"); printf("Sally shouted,\n"); printf("\"By the Great Pumokin,what was that!\""); return 0; }
Enter a floating-point value: 64.25input
fixed-point notation: 64.250000io
exponential notation: 6.425000e+01float
p notation: 0x1.01p+6程序
#include<stdio.h> int main() { float fds=64.25; printf("Enter a floating-point value:%.2f\n",fds); printf("fixed-point notation:%f6\n",fds); printf("exponential notation:%e\n",fds); printf("p notation:%a",fds); return 0; }
#include<stdio.h> int main() { long totalSecond; int age; printf("please input your age\n"); scanf("%d",&age); totalSecond=age*3.156e7; printf("you have lived %d second\n",totalSecond); return 0; }
#include<stdio.h> #define MASS_H2O 3.0e-23 #define MASS_QT 950 int main() { float quarts,countH2O; printf("please input the number of quarts of water\n"); scanf("%f",&quarts); countH2O=quarts*MASS_QT/MASS_H2O; printf("%f quarts of water contain %e count of H2O",quarts,countH2O); return 0; }
#include<stdio.h> #define MASS_yc 2.54 int main() { int yc; float longth; printf("please input the number of yc\n"); scanf("%d",&yc); longth=yc*MASS_yc; printf("your longth is %f cm",longth); return 0; }
#include<stdio.h> int main() { float a,b,c,d,e; printf("please input the number of bulk\n"); scanf("%f",&a); b=2*a; c=8*a; d=16*a; e=3*d; printf("品脫=%f,\n盎司=%f,\n湯匙=%f,\n茶勺=%f,\n",b,c,d,e); return 0; }
#include<stdio.h> int main() { int c; printf("輸入一個ASCII碼值(如:66)\n"); scanf("%d",&c); printf("字符爲%c\n",c); return 0; }