下面程序的运行结果是______。 #include < stdio.h > main() { int a[5],i; for(i=0;i< 5;i++) { a[i]=9*(i-2+4*(i >3))%5; printf("%2d",a[i]); } }
举一反三
- 下面程序的运行结果是( ) int main() { int a[6],i; for(i=1;i<6;i++) { a[i]=9*(i-2+4*(i>3))%5; printf("%2d",a[i]); } }
- 下面程序的运行结果是 #include<stdio.h> int main() { int a[]= {2,3,5,4},i; for(i=0; i<4; i++) switch(i%2) { case 0: switch(a[i]%2) { case 0: a[i]++; break; case 1: a[i]--; } break; } for(i=0; i<4; i++) printf("%2d",a[i]); printf("\n"); return 0; }
- 下面程序的运行结果是______。 #include < stdio.h > main() { int a[3][3]={1,2,3,4,5,6,7,8,9},i; for(i=0;i<=2;i++) printf("%d ",a[i][2-i]); }
- 有以下程序,运行结果是()#include<stdio.h>main(){inti=5;do{if(i%3==1)if(i%5==2){printf("*%d",i);break;}i++;}while(i!=0);printf("\n");}(3.0分)
- 【单选题】下面程序执行后的输出结果是()。#include <stdio.h>int main(){int i=0,s=0;for (;;) {if(i==3||i==5) continue;if (i==6) break;i++; s+=i;};printf("%d",s); return 0;}#include <stdio.h>int main(){int i=0,s=0;for (;;) {if(i==3||i==5) continue;if (i==6) break;i++; s+=i;};printf("%d",s); return 0;}#include <stdio.h>int main(){int i=0,s=0;for (;;) {if(i==3||i==5) continue;if (i==6) break;i++; s+=i;};printf("%d",s); return 0;}#include <stdio.h>int main(){int i=0,s=0; A. 10 B. 13 C. 21 D. 死循环