以下程序的运行结果是________。
#include
int main()
{ int a=12345,b=1234;
float c=34567.899;
printf("%4d\n",a);
printf("%d\t%s\n",b,"Welcome");
printf("%10.2f\n",c);
return 0;
}
#include
int main()
{ int a=12345,b=1234;
float c=34567.899;
printf("%4d\n",a);
printf("%d\t%s\n",b,"Welcome");
printf("%10.2f\n",c);
return 0;
}
举一反三
- 以下程序运行后的输出结果是_______。#include<;stdio.h>;int f(int n){if(n==0||n==1) return 1;elsereturn n+f(n-1);}int main(){printf(“%d\n”,f(0));printf(“%d\n”,f(1));printf(“%d”,f(5));}
- #include int f(int t[],int n); main() {int a[4]={1,2,3,4},s; s=f(a,4); printf(“%d”,s); } int f(int t[],int n) {if (n>0) return t[n-1]+f(t,n-1); else return 0;} 程序运行后的输出结果是
- Which of the following program is right? A: include <stdio.h> int main(); { /*programming*/ printf("programming!\n"); return 0; } B: include <stdio.h> int main() { /*programming*/ printf("programming!\n"); return 0; } C: include <stdio.h> void main() { /*programming*/ printf("programming!\n") return 0; } D: include <stdio.h> int mian() { /*programming*/ printf("programming!\n"); return 0; }
- 以下程序中,运行结果是36的有()。 A: include <stdio.h> B: define M(y) y*y int main() { printf("%d\n",M(6+0)); return 0; } C: include <stdio.h> D: define M(y) (y)*(y) int main() { printf("%d\n",M(6+0)); return 0; } E: include <stdio.h> int M(int y) { return y*y; } int main() { printf("%d\n",M(6+0)); return 0; } F: include <stdio.h> int M(int y) { return (y)*(y); } int main() { printf("%d\n",M(6+0)); return 0; }
- 以下程序没有语法问题的是() A: B: include<;stdio.h>;int main( ){int x , y = 5 ; printf( "%d\n" , x / y ) ; return 0 ;} C: D: include<;stdio.h>;int main( ){int x = 3 ;y = 5 ; printf( "%d\n" , x / y ) ; return 0 ;} E: F: include<;stdio.h>;int main( ){int x = 3 ,y ; printf( "%d\n" , x / y ) ;y = 5; return 0 ;} G: H: include<;stdio.h>;int main( ){int x = 3 , y = 5 ; printf( "%d\n" , x / y ) ; return 0 ;}