网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

若有int n = 2;执行语句:n += n-= n*=n后, n= 。


参考答案和解析
-4
更多 “若有int n = 2;执行语句:n += n-= n*=n后, n= 。” 相关考题
考题 若有定义 : float x=1.5; int a=1,b=3,c=2; 则正确的 switch 语句是A)switch(x){ case 1.0: printf("*\n");case 2.0: printf("**\n");}B)switch((int)x);{ case 1: printf("*\n");case 2: printf("**\n");}C)switch(a+b){ case 1: printf("*\n");case 2+1: printf("**\n");}D)switch(a+b){ case 1: printf("*\n");case c: printf("**\n");}

考题 若有说明:int n=2,*p=n,*q=p;,则以下非法的赋值语句是( )。A.p=q B.*p=*q C.n=*q D.p=*n

考题 若有以下宏定义:#define N 2#define Y(n)((N+1)*n)则执行语句z=2*(N+Y(5));后的结果是( )。A.语句有错误B.z=34C.z=70D.z无定值

考题 若有定义:float x=1.5;int a=1,b=3,c=2;,则正确的switch语句是A.switch(x) {case 1.0:printf("*\n"); case 2.0:printf("**\n");}B.switch((int)x); {case 1:printf("*\n"); case 2:printf("**\n");}C.switch(a+B) {case 1:printf("*\n"); case 2+1:printf("**\n");}D.switch(a+B) {case 1:printf("*\n"); case c:printf("**\n");}

考题 执行下列语句后,变量n的值是______。int n=0;for(int i=1;i<=3;i++)for(int j=1;j<<=i;j++)n++;

考题 有如下程序:includeusing namespace std;Class Test{public:Test(){n+=2;}~Test(){n- 有如下程序: #include<iostream> using namespace std; Class Test { public: Test() {n+=2;} ~Test() {n-=3;} static int getNum() {return n;} private: static int n; }; int Test::n=1; int main() { Test*p=new Test;A.n=0B.n=1C.n=2D.n=3

考题 有如下程序: #include(iostream> using namespace std; Class Test { public: Test() {n+=2;} ~Test() {n-=3;) static int getNum() {return n;} private: static int n; }; int Test::n=1; int main() { Test*p=new Test;A.n=0B.n=1C.n=2D.n=3

考题 在下面循环语句中内层循环体S语句的执行总次数为( )。for(int i=0; ifor(int j=i; jA、n2B、(n+1)/2C、n(n-1)/2D、n(n+1)/2

考题 在下面循环语句中循环体执行的次数为( )。for(int i=0; iif(i>n/2) break;A、n/2B、n/2+1C、n/2-1D、n-1

考题 若有以下程序main(){ int p,a=5;if(p=a!=0)printf("%d\n",p);elsepfintf("%d\n",p+2);}执行后输出结果是【 】。

考题 有如下程序: include using namespace std; class Test { public 有如下程序: #include<iostream> using namespace std; class Test { public: Test(){n+=2;} ~Test(){n-=3;} static int getNum(){return n;} private: static int n; }; int Tesl::n=1 int main() { Test*p=new Test; delete p; cout<<"n="<<Tes::tgetNum()<<endl; return 0; } 执行后的输出结果是A.n=0B.n=1C.n=2D.n=3

考题 有如下程序: include using namespace std; class Test{ public: Tes 有如下程序: #include<iostream> using namespace std; class Test{ public: Test() {n+=2;} ~Test() {n-=3;} static int getNum(){return n;} private: static int n; }; int Test::n=1; int main() { Test*p=new Test; delete p; cout<<"n="<<Test::getNum()<<endl; return 0; } 执行后的输出结果是( )。A.n=0B.n=1C.n=2D.n=3

考题 有如下程序:include usingnamespacestd:class Test{public: Test(){n+=2; ~Test(){n- 有如下程序:#include <iostream>using namespace std:class Test{public: Test() {n+=2; ~Test() {n-=3; ; static int getNum() {return n;}privaue: static int n:};int Test::n=1;int main(){ Test* p=new Test; delete p; cout<<"n="<<Test::getNum()<<end1; return 0;} 执行后的输出结果是A.n=0B.n=1C.n=2D.n=3

考题 有如下程序:include using namespace std;class Test{public:Test(){n+=2; }~Test(){ 有如下程序: #include <iostream> using namespace std; class Test { public: Test() {n+=2; } ~Test() {n-=3; } static int getNum() {return n; } private: static int n; }; int Test::n=1; int main() { Test* p=new Test; delete p; cout<<"n="<<Test::getNum()<<endl; return 0; } 执行该程序的输出结果是( )。A.n=0B.n=1C.n=2D.n=3

考题 有下列程序: include using namespace std; classTest{ public: Test(){n+=2;} ~Test 有下列程序: #include<iostream> using namespace std; classTest{ public: Test() {n+=2;} ~Test() {n-=3;} static int getNum(){return n;} private: static int n; }; int Test::n=1; int main() { Test*p=new TestA.n=0B.n=lC.n=2D.n=3

考题 有如下程序: include using namespace std;class Test {public: Test() {n+=2;} ~Tes 有如下程序: #include <iostream> using namespace std; class Test { public: Test() {n+=2;} ~Test() {n-=3;} static int getNum(){retum n;} private: static int n; }; int Test:: n=1; int main() { Test*p=new Test; delete p; cout<<"n="<<Test:: getNum()<<end1; return 0; };执行后的输出结果是______.A.n=0B.n=1C.n=2D.n=3

考题 如下程序的执行结果是 ( ) main( ) { int n=1; printf("%d%d%\n",n,+ +n,n- -); }A.1 1 1B.1 2 2C.1 2 3D.1 2 1

考题 有下列程序:includeusing namespace Std;class Test{public:Test(){n+=2;}~Test(){n- 有下列程序: #include<iostream> using namespace Std; class Test { public: Test() {n+=2;} ~Test() {n-=3;} static int getNum(){return n;} private: static int n; }; int Test∷n=1; int main()A.n=0B.n=lC.n=2D.n=3

考题 若有如下程序: int sub() {static int n=1; int x=1; x*=n;n++; return x; } main() {int n,t=1; for(n=1;n<6;n++)t*=sub(); printf("%d\n",t); } 则程序运行后的输出结果是( )A.15B.120C.34560D.-30976

考题 设整型变量n的值为2,执行语句“n+=n-=n*n;”后,n的值是__________A.0B.4C.- 4D.2

考题 在下面循环语句中循环体执行的次数为(46)。for(int i=0;in/2)break;A.n/2B.n/2+1C. 在下面循环语句中循环体执行的次数为(46)。 for(int i=0;i<0; i+ +)if(i>n/2)break;A.n/2B.n/2+1C.n/2-1D.n-1

考题 若有说明class Y{//…;public:staticint n;};int Y::n;Y objY;,则对n的正确访问语句是()A、n=1;B、Y::n=1;C、objY::n=1;D、Y-n;

考题 若有:intx=1,n=5;则执行语句x%=(n%2)后,x的值为()。A、3B、2C、1D、0

考题 若有以下宏定义:  #define  N  2  #define  Y(n)  ((N+1)*n)  则执行赋值语句z=2*(N+Y(5));后,变量z的值是多少?

考题 C#中执行下列语句后,int n=21;n=1;n的值为()

考题 单选题若有说明class Y{//…;public:staticint n;};int Y::n;Y objY;,则对n的正确访问语句是()A n=1;B Y::n=1;C objY::n=1;D Y-n;

考题 填空题C#中执行下列语句后,int n=21;n=1;n的值为()

考题 问答题若有以下宏定义:  #define  N  2  #define  Y(n)  ((N+1)*n)  则执行赋值语句z=2*(N+Y(5));后,变量z的值是多少?