以下对结构体变量stu1中成员age的非法引用是()。
struct student
{ char name[10];
int age ;
} stu1 ,*p; p=&stu1;
A. stu1.age
B. p->age
C. (*p).age
D. student.age
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034650c.html
点击查看答案
下面那个选项是正确的()。 (每行程序前面的数字表示行号)
1 main()
2 {
3 float a[3]={0};
4 int i;
5 for(i=0;i<3;i++) scanf(“%f”,&a[i]);
6 for(i=1;i<4;i++) a[0]=a[0]+a[i];
7 printf(“%f\n”,a[0]);
8 }
A. 没有错误
B. 第3 行有错误
C. 第5 行有错误
D. 第6 行有错误
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346505.html
点击查看答案
有以下程序
#include
void main()
{
int a[][2]={10,20,30,40,50,60},(*p)[2];
p=a;
printf("%d\n",*(*(p+2)+1));
}
程序运行后的输出结果是 ( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650e.html
点击查看答案
有以下程序
#include "stdio.h"
void main()
{ int a=0,b=1,c=0,d=20;
if(a) d=d-10;
else if(!b)
if(!c) d=1;
else d=25;
printf("d=%d\n",d);
}
执行后的输出结果是( )。
A. d=10
B. d=15
C. d=20
D. d=25
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650a.html
点击查看答案
已知 int i,a; 执行语句“i=(a=2*3,a*5),a+6;”后,变量a的值是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346511.html
点击查看答案
现有程序完成a、b两个值的交换,空白处正确的答案应该是( )。
main()
{int a,b,t;
t=b ;
b=a ;
________ ;
}
A. a=b
B. a=t
C. b=t
D. t=a
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034650d.html
点击查看答案
设整型变量a为5,使b不为2的表达式是( )。
A. b=a/2
B. b=6-(--a)
C. b=a%2
D. b=a>3?2:1
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651b.html
点击查看答案
下面程序的运行结果是 ( )。
#include “stdio.h”
int f(int a[],int n)
{ if(n>1)
return a[0] + f(a+1, n-1);
else
return a[0];
}
main()
{ int aa[10]={1,2,3,4,5,6,7,8,9,10}, s;
s = f(aa+2,4); printf("%d\n", s);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346513.html
点击查看答案
有以下程序
#include
#include
void fun(char *w,int m)
{char s,*p1,*p2;
p1=w;p2=w+m-1;
while(p1}
main()
{char a[]=”123456”;
fun(a,strlen(a)); puts(a);
}
程序运行后的输出结果是( )。
A. 654321
B. 116611
C. 161616
D. 123456
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346514.html
点击查看答案
有以下程序
#include "stdio.h"
void main()
{ int x=0x02ff,y=0x0ff00;
printf("%d\n",(x&y)>>4|0x005f);
}
执行后的输出结果是( )。
A. 127
B. 255
C. 128
D. 1
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650e.html
点击查看答案