• 2022-05-30
    Which of the following program is right?
    A: include int main(); { /*programming*/ printf("programming!\n"); return 0; }
    B: include int main() { /*programming*/ printf("programming!\n"); return 0; }
    C: include void main() { /*programming*/ printf("programming!\n") return 0; }
    D: include int mian() { /*programming*/ printf("programming!\n"); return 0; }
  • B

    举一反三

    内容

    • 0

      以下程序的执行结果是()#include<stdio.h>int main(){printf("1** #2# ");printf(" 789 ");return 0;}

    • 1

      执行以下程序后,输出结果第一行为,第二行为。#include<;stdio.h>;int n=0;void f();int main(){int n;n=2;f();printf("%d\n",n);return 0;}void f(){n=n+5;printf("%d\n",n);}

    • 2

      以下程序的运行结果是________。 #include <stdio.h> 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; }

    • 3

      以下程序运行后的输出结果是_______。#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));}

    • 4

      中国大学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;