[单选题]

有如下程序:include using namespace std;int main(){ int *p; *p = 9;cout << "The

有如下程序: #include <iostream> using namespace std; int main() { int *p; *p = 9; cout << "The value at p: " << *p; return 0; } 编译运行程序将出现的情况是( )。

A.编译时出现语法错误,不能生成可执行文件

B.运行时一定输出:The value at p:9

C.运行时一定输出:The value at p:*9

D.运行时有可能出错

参考答案与解析:

相关试题

有如下程序:#include using namespace std;int m

[单选题]有如下程序:include using namespace std;int main( ){int*P;*P=9;cout<<"The value有如下程序: #include <iostream> using namespace std; int main( ){ int*P; *P=9; cout<<"The value at P:"<<*P: return 0; } 编译运行程序将出现的情况是A.编译时出现语法错误,不能生成可执行文件B.运行时一定输出:The value at P:

  • 查看答案
  • 有如下程序: #include using namespace std; int

    [单选题]有如下程序: include using namespace std; int main() { cout.f有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*') cout.width(6); cout.fill('#') cout<<123<<endl; return 0; } 执行后的输出结果是A.###123B.123###C.***123D.123***

  • 查看答案
  • 有如下程序 #include using namespace std; int

    [单选题]有如下程序 include using namespace std; int i=1; class Fun {有如下程序 #include <iostream> using namespace std; int i=1; class Fun { public: static int i; int value( ){ return i-l;} int value( )const { return i+1;} }; int Fun::i=2; int main( ){ int i=3; Fun f

  • 查看答案
  • 有如下程序: #include using namespace std; int

    [单选题]有如下程序: include using namespace std; int main(){ int sum;有如下程序: #include<iostream> using namespace std; int main(){ int sum; for(int i=0;i<6;i+=3){ sum=i; for(int j=i;j<6;j++)sum+=j; } cout<<sum<<end1; return 0; } 运行时的输出结果是( )。A.3B.10C.12D.15

  • 查看答案
  • 有如下程序: #include using namespace std; int

    [单选题]有如下程序: include using namespace std; int main() { int *p;有如下程序: #include<iostream> using namespace std; int main() { int *p; *p=9; cout<<"The value at p:"<<*p; return 0; } 编译运行程序将出现的情况是A.编译时出现语法错误,不能生成可执行文件B.运行时一定输出:The value at p:9C.运行时一定输出:The val

  • 查看答案
  • 有如下程序: #include using namespace std; int

    [单选题]有如下程序: include using namespace std; int main() { void fu有如下程序: #include<iostream> using namespace std; int main() { void function(double val); double val; function(val); cout<<val; return 0; } void function(double val) { val=3; } 编译运行这个程序将出现的情况是A.编译出

  • 查看答案
  • 有如下程序: include using namespace std; int

    [主观题]有如下程序: include using namespace std; int strle(char a[],char b[]) {int num=有如下程序:include <iostream>using namespace std;int strle(char a[],char b[]){int num=O,n=O;while (* (a+num) !='/0')num++;while (b [n] ){* (a+num)=b [n];num++;n++;}return(num);}i

  • 查看答案
  • 有如下程序: #include using namespace std; int

    [单选题]有如下程序: include using namespace std; int main(){ int f, f1=0, f2=1; for(int有如下程序:#include<iostream>using namespace std;int main(){int f, f1=0, f2=1;for(int i=3; i<=6; i++) {f=f1+f2;f1=f2; f2=f;}cout<<f<<end1;return 0;}运行时的输出结果是( )。A.) 2B.) 3C.) 5D.) 8

  • 查看答案
  • 有如下程序: #include using namespace std; int

    [单选题]有如下程序: include using namespace std; int main(){ int a[6]={23, 15, 64, 33,有如下程序:#include<iostream>using namespace std;int main(){int a[6]={23, 15, 64, 33, 40, 58};int s1, s2;s1, s2=a[0];for(int*p=a+1; p<a+6; p++) {if(s1>*p)s1=*p;if(s2<*p)s2=*p;}cout<<

  • 查看答案
  • 有如下程序: #include using namespace std; int

    [单选题]有如下程序: include using namespace std; int main() { void fun有如下程序: #include<iostream> using namespace std; int main() { void function(double val); double val; function(val); cout<<val; return 0; } void function(double val) { val=3; } 编译运行这个程序将出现的情况是( )。

  • 查看答案
  • 有如下程序:#include using namespace std;int m