3、#include<stdio.h>int main____{float c=3.0,d=4.0;if (c>d) c=5.0;elseif(c==d) c=6.0;else c=7.0;printf("%.1f",c);return 0;}运行结果为:(4.0)
举一反三
- #include <stdio.h> void main() { float c=3.0,d=4.0; if(c>d) c=5.0; else if(c==d) c=6.0; else c=7.0; printf("%.1f ",c); }
- 以下程序中,运行结果是36的有()。 A: B: include <stdio.h> C: define M(y) y*y int main() { printf("%d ",M(6+0)); return 0; } D: E: include <stdio.h> F: define M(y) (y)*(y) int main() { printf("%d ",M(6+0)); return 0; } G: H: include <stdio.h> int M(int y) { return y*y; } int main() { printf("%d ",M(6+0)); return 0; } I: J: include <stdio.h> int M(int y) { return (y)*(y); } int main() { printf("%d ",M(6+0)); return 0; }
- 下列程序的运行结果是 。 #include <stdio.h>int main(){ char ch='F';printf("%c",ch+32-3);return 0; }
- 以下程序输出结果是( ).#include <stdio.h>int main() { int a=2,*pa=&a; float n=5.888,b,*pn=&n; b=*pa+(int)*pn; printf("%.1f ",b); return 0;} A: 8 B: 7 C: 8.0 D: 7.0
- 在下列选项中,有正确的程序是( )。 A: B: include <stdio.h>; C: define ABC 345int main( ){int a1;a1=ABC;return 0;} D: E: include <stdio.h> F: define ABC 345;int main( ){int a1;a1=ABC;return 0;} G: H: include <stdio.h> I: define ABC 345int main( ){int a1;a1=ABC;return 0;} J: K: include <stdio.h> L: define ABC 345int main( ){a1=ABC;int a1;return 0;}