Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

What is the output of the below code 1?

  Shared By: William Evans    Date: Dec 03    Category: C++ Programming    Views: 1825

Answer:

Consider the following code segment:
int main()
{
double f, *f_ptr=&f;
f=5.25;
f_ptr=4.5;
cout<< “Value of f is:” << “ “ << f;
return 0;
}

What is the output of the above code?

Options

a) Value of f is: 5.25
b) Value of f is: <hexadecimal address>
c) Value of f is: 4.5
d) Compiler error


Answer : d) Compiler error

Share: 
 

Didn't find what you were looking for? Find more on What is the output of the below code 1? Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: