正在加载图片...
increment Increment printf(“%d”,x) 【题8.37】以下程序的运行结果是 #include <stdio. h> main( int a=l, b=2 c=max(a, b) max(int x, Int y int z return (z) 【题8.38】以下程序的功能是根据输入的“y”(“Y”)与“n”(“N”),在屏幕上分别显 示出“ This is yes.”与“ This is no.”。请填空。 void YesNo(char ch case"Y’: printf(“ nThis is yes.n”);【1】 N': printf("\nThis is No. \n"):[21 maln har ch printf(“ AnEnter a char‘y’,“Yor‘nincrement(); increment(); } increment() { int x=0; x+=1; printf(“%d”,x); } 【题 8.37】以下程序的运行结果是 。 #include <stdio.h> main() { int a=1,b=2,c; c=max(a,b); printf(“max is %d\n”,c); } max(int x,int y) { int z; z=(x>y)?x:y; return(z); } 【题 8.38】以下程序的功能是根据输入的“y”(“Y”)与“n”(“N”),在屏幕上分别显 示出“This is YES.”与“This is NO.”。请填空。 #include <stdio.h> void YesNo(char ch) { switch(ch) { case ‘y’: case ‘Y’: printf(“\nThis is YES.\n”); 【1】; case ‘n’: case ‘N’: printf(“\nThis is No.\n”); 【2】; } } main() { char ch; printf(“\nEnter a char ‘y’,‘Y’or‘n’,‘N’:”);
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有