有以下程序段: #include <stdio.h> int a, b, c; a=10; b=50; c=30; if (a>b) a=b, b=c; c=a; printf("a=%d b=%d c=%d\n", a, b, c); 程序的输出结果是()
A.a=10 b=50 c=30
B.a=10 b=50 c=10
C.a=10 b=30 c=10
D.a=50 b=30 c=50
A.a=10 b=50 c=30
B.a=10 b=50 c=10
C.a=10 b=30 c=10
D.a=50 b=30 c=50
第1题
A.3
B.50
C.2
D.96
第2题
A、a=10 b=50 c=30
B、a=10 b=50 c=10
C、a=10 b=30 c=10
D、a=50 b=30 c=50
第3题
include<stdio.h>
main( )
{ int a=12,C;
c=(a<<2)<<1;
printf("%d\n",c);
}
程序运行后的输出结果是( )。
A.3
B.50
C.2
D.96
第4题
A、a=10 b=50 c=30
B、a=10 b=50 c=10
C、a=10 b=30 c=10
D、a=50 b=30 c=50
第5题
A、a=10 b=50 c=30
B、a=10 b=50 c=10
C、a=10 b=30 c=10
D、a=50 b=30 c=50
第6题
第7题
1.阅读程序,程序输出结果 (1) 。
#include<stdio.h>
main( )
{
int x,y;
x=-50%3;
y=50%(-3)
printf( "%d,%d\n" , x , y );
}
2.阅读程序,程序输出结果 (2) 。
#include<stdio.h>
main( )
{
char c='M',str;
str=c+32;
printf("%c\n",str);
}
3.阅读程序,程序输出结果 (3) 。
#include<stdio.h>
main( )
{
int a=10, b=14, y;
if (a<b) y=a*b;
else y=a/b;
printf ("y=%d\n",y);
}
4.阅读程序,程序输出结果 (4) 。
#include<stdio.h>
main( )
{
inta[3][4]={10,12,23,4,5,6,17,18,19,1,2,3},i,j,m;
m=a[0][0];
for(i=0;i<3;i++)
{
for(j=0;j<4;j++)
if(a[i][j]>m)m=a[i][j];
}
printf("m=%d\n",m);
}
5.阅读程序,程序输出结果 (5) 。
#include <stdio.h>
int fun(int n)
{ int i,y=1;
for(i=1; i<=n; i++)y=y*i;
return y;
}
main( )
{
int a=5,p;
p=fun(a);
printf("p=%d\n",p);
}
第8题
有以下程序段: #include <stdio.h> int main(){ int a, b, c; a=10; b=50; c=30; if (a>b) a=b, b=c; c=a; printf("a=%d b=%d c=%d\n", a, b, c); return 0; }程序的输出结果是( )
A、a=10 b=50 c=30
B、a=10 b=50 c=10
C、a=10 b=30 c=10
D、a=50 b=30 c=50
第9题
A、5,10,11
B、15,5,10
C、5,10,15
D、10,15,11
第10题
以下程序中函数Reverse的功能是对数组a中的前一半元素逆序、后一半元素逆序,再将逆序后的前、后两部分数据位置交换。按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。 例如:主程序中数组b中的元素为{16,22,13,41,50,62,27,18,9,10},调用函数Reverse后,数组b中元素变为 {10 9 18 27 62 50 41 13 22 16}#include <stdio.h> void Reverse(int a[],int n) { int i,t; for(i=0;________;i++) { t=a[i]; __________; a[n-i]=t; } } int main() { int b[10]={16,22,13,41,50,62,27,18,9,10}; int i,s=0; __________; for(i=0;i<10;i++) { printf("%4d",b[i]); } return 0;> A、第5行: i<=n 2 第8行: a[i]="a[n-i]" 第17行:> B、第5行: i<=n 第8行: a[n-i]="a[i]" 第17行:> C、第5行: i<=n 2 第8行: a[n]="a[i]" 第17行:> D、第5行: i<=n 2 第8行: a[i]="a[n]" 第17行:>
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!