下面程序的输出结果是: #include int main() { int a=3; printf("a=%d,",a); a=a+1; printf("a=%d,",a); a*=2; printf("a=%d\n",a); return 1; }
举一反三
- 下列程序运行的结果是__________ 。 #include int main( ) { int i; for (i=1; i<=5; i++) { if (i%2) printf("*"); else printf("#"); } printf("$\n"); 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 n) { if(n == 1) return 1; else return n + f(n - 1);}int main(void) { printf("%d\n", f(5)); return 0;}
- 中国大学MOOC: 以下程序输出的结果是()# include <stdio.h>int main(){ int a = 4; switch(a ) { case 0: printf("this is 0\n"); break; case 1: printf("this is 1\n"); break; case 2: printf("this is 2\n"); break; default: printf("this is default\n"); } return 0;
- #include [stdio.h] int main() { int a=1; int *pa; pa=&a; printf("a=%d\n",a); printf("*pa=%d\n",*pa); *pa=2; printf("a=%d\n",a); return 0; }的运行结果()