(40)以下程序執(zhí)行后a的值是
main()
{ int x,y=252,i=386,*m=&y,*z=&i;
x=(z==y);
printf("%d",x);
}
A)252 B)1 C)0 D)運行時出錯,x無定值
【參考答案】C
(41)閱讀下列程序,當運行函數(shù)時,輸入asd af aa z67,則輸出為
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
int fun (char *str)
{ int i,j=0;
for(i=0;str[i]!=′\0′;i++)
if(str[i]!=′ ′)str[j++]=str[i];
str[j]= ′\0′;
}
main()
{
char str[81];
int n;
clrscr();
printf("Input a string : ");
gets(str);
puts(str);
fun(str);
printf("%s\n",str);
}
A)asdafaaz67 B)asd af aa z67 C)asd D)z67
【參考答案】A
相關(guān)推薦:
2009年9月計算機等級考試二級C語言模擬試題(1) 2009年9月計算機等級考試二級C語言模擬試題(2)