正在加载图片...
第一部分c语言程序设计上机指导 6. #include <stdio. h> main() inta[]={1,2,3,4,5,6} int *p, i i printf("n1=d,n2=旨d\n”,*p,*(p+3) 行结果 #include <stdio. h> mian( inta[]={1,3,5,7,9}; int*p=a printf(“器d\n”,(*p++)) printf("d\n”,(*++p) printf("gd\n",(* ++p)+ 分析结果 运行结果 二、完成程序 要求:根据要求,分析给出的上下语句,填写程序。 设有以下程序,为使之正确运行,请在 上填写正确内容。 #include <stdio. h> main() I int x=2,y=4 (x,y) printf(Mz=号d",z); char s1[20]=“2008 char s2[ ]=" Beijing"; strcat( s1, s2) printf(”暑s/n”,s1) 2.用带参数的宏实现变量值的输入与输出,请在 上填写正确内容。第一部分 C 语言程序设计上机指导 ·71· ·71· 6. #include <stdio.h> main() { int a[ ]={1,2,3,4,5,6}; int *p ,i ; p=a; *(p+3)+=2; printf(“n1=%d ,n2=%d \n”,*p , *(p+3)); } 分析结果 运行结果 7. #include <stdio.h> mian() { int a[ ]={1,3,5,7,9}; int *p=a; printf(“%d\n”,(*p++)); printf(“%d\n”,(* ++p)); printf(“%d\n”,(* ++p)++); } 分析结果 运行结果 二、完成程序 要求:根据要求,分析给出的上下语句,填写程序。 1. 设有以下程序,为使之正确运行,请在_______上填写正确内容。 __________________________ __________________________ #include <stdio.h> main() { int x =2 , y=4 , z; z = pow(x,y) ; printf(“z=%d” ,z); char s1[20]= “2008”; char s2[ ]= “ Beijing”; strcat( s1,s2); printf(” %s/n” ,s1); } 2. 用带参数的宏实现变量值的输入与输出,请在_______上填写正确内容
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有