更多"有下面的程序:#include <stdio, h>main ( ) "的相关试题:
[单项选择]有下面的程序:
#include <stdio, h>
main ( )
enum team my,your=4,his,her=his+10;
prinff(" % d %d %d %d //n" ,my,your,his,her);
此程序的输出结果是()。
A. 0 1 2 3
B. 0 4 0 1 0
C. 0 4 5 1 5
D. 1 4 5 1 5
[填空题]有下面的程序:
#include <stdio, h>
main ( )
{ enum team {my,your=4,his,her=his+10};
prinff(" % d %d %d %d /n" ,my,your,his,her);
此程序的输出结果是 【15】 。
A) 0 1 2 3 B) 0 4 0 1 0 C) 0 4 5 1 5 D) 1 4 5 1 5
[单项选择]阅读下面程序,则程序段的功能是
#include"stdio.h"
main( )
int c[]=23,1,56,234,7,0,34,i,j,t;
for(i=1;i<7;i++)
t=c[i];j=i-1;
while(j>=0 && t>c[j])
c[j+1]=c[j];j--;
c[j+1]=t;
for(i=0;i<7;i++)
printf("%d",c[i]);
putchar(’/n’);
A. 对数组元素的升序排列
B. 对数组元素的降序排列
C. 对数组元素的倒序排列
D. 对数组元素的随机排列
[单项选择]阅读下面程序,程序执行后的结果为()。
#include "stdio.h"
main( )
char *str="abcdefghijklmnopq";
while(*str++!=’e’);
printf("%c/n",*str);
A. f
B. a
C. e
D. q
[单项选择]下面程序的运行结果是( )。
#include<stdio.h>
main( )
static char a[]="Languagef" ,b[]=" programe";
char*p1,*p2;int k;
p1=a;p2=b;
for(k=0;k<=7;k++)
if(*(p1+k)==*(p2+k)) printf("%c",*(p1+k));
A. gae
B. ga
C. Language
D. 有语法错
[填空题]下面程序的输出结果是 【18】 。
# include<stdio.h>
main ( )
char * p="BOOL""OPK","H","SP";
int i;
for (i=3,i>=0;i- -,i- -)printf("%",*p[i]);
printf("/n");
[单项选择]下面程序的运行结果是
include<stdio.h>
main( )
int a=28,b;
char s[10],*p;
p=s;
dob=a%16;
if(b<10) *p=b+48;
else*p=b+55;
p++;
a=a/5;
while(a>0);
*p=’/0’;
puts(s);
A. 10
B. C2
C. C51
D. /0
[填空题]下面程序的输出结果是 【16】 。
#include<stdio.h>
main( )
static char a[]="language" ,b[]="program";
char*ptrl=a,*ptr2=b;
int k;
for(k=0;k<7;k++)
if(*(ptrl+k)==*(ptr2+k))
printf("%c",*(ptrl+k));
[填空题]下面程序段可以求出n!的值。
#include<stdio.h>
main( )
{int i,n;
long np;
scanf("%d",&n);
______;/*第一空*/
for(i=2;______;i++)/*第二空*/
______;/*第三空*/
printf("n=%d,n!=%ld/n",n,np);
}
[填空题]下面程序可用来统计文件中字符的个数。
#include<stdio.h>
main( )
{FILE *fp;
long num=0;
if((fp=______)==NULL)/*第一空*/
{printf("Can not open file/n");exit(0);}
while(______)/*第二空*/
{______;}/*第三空*/
printf("num=%d/n",num);
fclose(fp);
}
[单项选择]下面程序的输出结果是()。
#include<stdio.h>
main( )
char a[]=’a’,’b’,’c’,’d’,’f’,’g’,*p;
p=a;
printf("%c/n",*p+4);
A. a
B. b
C. e
D. f
[单项选择]下面程序运行后的输出结果是()。
#include<stdio.h>
main( )
int a[5]=1,0,4,2,0,b[5]=1,2,3,4,5,i,s=0;
for(i=0;i<5;i++)s=s+b[a[i]];
printf("%d/n",s);
A. 12
B. 15
C. 11
D. 8
[填空题]下面程序的输出是______。
#include<stdio.h>
main( )
{char x=0.40;
printf("%d/n",x=x<<1);}
[填空题]下面程序段可以求出n!的值。
#include<stdio.h>
main( )
int i,n;
long np;
scanf("%d",&n);
______;/*第一空*/
for(i=2;______;i++)/*第二空*/
______;/*第三空*/
printf("n=%d,n!=%ld/n",n,np);
[填空题]下面程序的输出是______。
#include<stdio.h>
main( )
char x=0.40;
printf("%d/n",x=x<<1);
[填空题]下面程序的运行结果是______。
#include<stdio.h>
main( )
{ int y,a;
y=2,a=1;
while(y--!=-1)
{do{a*=y;a++;}while(y--);}
printf("%d,%d",a,y);}
[填空题]下面程序的输出结果是______。
# include <stdio.h>
main( )
staic char b[]="Goodbye";
char * chp = &b [7];
while(- - chp>=&b[0])putchar (* chp);
printf("/n");