10、若a为整型变量,则以下语句 。 a=-2L; printf("%d\n",a);A.赋值不合法B.输出为不确定的值C.输出值为-2D.输出值为2
10、若a为整型变量,则以下语句 。 a=-2L; printf("%d\n",a);
A.赋值不合法
B.输出为不确定的值
C.输出值为-2
D.输出值为2
参考答案和解析
C
相关考题:
以下程序的功能是:将输入的正整数按逆序输出。例如:若输入 135 则输出 531 。请填空。#include stdio.hmain(){ int n,s;printf("Enter a number : "); scanf("%d",n);printf("Output: ");do{ s=n%10; printf("%d",s); 【 10 】 ; }while(n!=0);printf("\n");}
有以下程序#include stdio.hmain( ){ int n,*p=NULL;*p=n;printf("Input n:"); scanf("%d",p); printf("output n:"); printf("%d\n",p);}该程序试图通过指针 p 为变量 n 读入数据并输出,但程序有多处错误,以下语句正确的是A)int n,*p=NULL;B)*p=n;C)scanf("%d",p)D)printf("%d\n",p);
若变量n中的值为24,则pint函数共输出【】行。void pint(int n,int aa[]){ int i; for(i=1; i=n; i++) { printf("%6d",aa[i]); if(!(i%5))printf("\n"); }printf("\n");}
有以下程序 include main() { int n,*p=NULL; *p=n; printf(" 有以下程序 #include <stdio.h> main() { int n,*p=NULL; *p=n; printf("Input n:");scanf("%d",p);printf("output n:");printf("%d\n",p); } 该程序试图通过指针p为变量n读入数据并输出,但程序有多处错误,以下语句正确的是A.int n,*p=NULL;B.*p=n;C.scanf("%d",p)D.printf("%d\n",p);
设变量均已正确定义并且赋值,以下与其他三组输出结构不同的一组语句是()A.x++;printf((“%d\n”,x);B.n=++x;printf((“%d\n”,n);C.++x;printf((“%d\n”,x);D.n=x++;printf((“%d\n”,n);
有以下程序#include stdio.hmain { int n,*p=NULL; *p=n; printf("Input n:"); scanf("%d",p); printf("output n:"); printf("%d\n",p);}该程序试图通过指针p为变量n读入数据并输出,但程序有多处错误,以下语句正确的是A.int n,*p=NULL; B.*p=n; C.scanf("%d",p) D.printf("%d\n",p);
设有定义:long x=123456L;,则以下能够正确输出变量x值的语句是( )A.printf("x=%d\n",x);B.printf("x=%ld\n",x);C.printf("x=%8dL\n",x);D.printf("x=%LD\n",x);
设变量均已正确定义并赋值,以下与其他三组输出结果不同的一组语句是( )。A.x++;printf("%dkn",x);B.n=++x;printf("%d\n",n);C.++x;printf("%d\n",x);D.n=x++;printf("%6d\n",n);
若变量n中的值为24,则print()函数共输出行,最后一行有个数。void print (int n,int aa[]){ int i; for(i=1; i1;i++) { printf("%6d",aa[i]); if(!(i%5)) printf("\n"); } printf ("\n");}
设变量均已正确定义并赋值,以下与其他三组输出结果不同的一组语句是A)x++;printf(”%d\n”,x);B)n=++x;printf(”%d\n”,n);C)++x;printf(”%d\n”,x);D)n=x==;printf(”%d\n”,n);
设有定义:long x=-123456L; 则以下能够正确输出变量x值的语句是_______。A.printf(“x=%d\n”,x)B.printf(“x=%ld\n”,x)C.printf(“x=?l\n”,x)D.printf(“x=%D\n”,x);
若变量已正确定义,在语句“if(W)printf("%d\n",k);”中,以下不可替代w的是( )。 A.ab+cS 若变量已正确定义,在语句“if(W)printf("%d\n",k);”中,以下不可替代w的是( )。A.ab+cB.ch=getcharC.a= =b+CD.a++
设有定义:10ng x=-123456L,则以下能够正确输出变量x值的语句是( )。A.printf("x=%d\n",x);B.printf("x=%1d\n",x);C.peintf("x=%8dL\n",x);D.printf('x=%LD\n",x);
下列各语句序列中,能够且仅输出整型变量a、b中最大值的是()。A、if(ab)printf(”%d/n”,a);printf(”%d/n”,b);B、printf(”%d/n”,b);if(ab)printf(”%d/n”,a);C、if(ab)printf(”%d/n”,a);elseprintf(”%d/n”,b);D、if(ab)printf(”%d/n”,a);printf(”%d/n”,b);
若k,g均为int型变量,则下列语句的输出为() k=017; g=111; printf("%d/t",++k); printf("%x/n",g++);A、15 6fB、16 70C、15 71D、16 6f
下列各语句中,能够输出整型变量a、b中最大值的是()。A、printf(”%d/n”,(ab)?a,b);B、(ab)?printf(”%d”,a):printf(”%d”,b);C、printf(”%d”,if(ab)aelseb);D、printf(”%d/n”,(ab)?a:b);
单选题有以下程序#includemain(){ intn,*p=NULL; *p=n; printf(Inputn:); scanf(%d,p); printf(outputn:); printf(%d,p);}该程序试图通过指针p为变量n读入数据并输出,但程序有多处错误,以下语句正确的是( )。