网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
若有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");}
考题
若有以下宏定义:#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");}
考题
有如下程序: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
考题
有如下程序: 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
考题
在下面循环语句中循环体执行的次数为(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;
考题
单选题若有说明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;
考题
问答题若有以下宏定义: #define N 2 #define Y(n) ((N+1)*n) 则执行赋值语句z=2*(N+Y(5));后,变量z的值是多少?
热门标签
最新试卷