Question

Write a C++ program IN VISUAL STUDIO CODE that will display the value and logical address...

Write a C++ program IN VISUAL STUDIO CODE that will display the value and logical address of an uninitialized float array with size twenty (20) and a reference pointing to the array.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The program is written in c++.

Source code:

#include<iostream>
int main()
{
   float a[20];
   int i=0;
   std::cout<<"Enter the elements of the array"<<std::endl;
   for(i=0;i<20;i++)
   {
       std::cin>>a[i];
   }
   for(i=0;i<20;i++)
   {
       std::cout<<a[i]<<std::ends; /* to print the value of array*/
   }
   std::cout<<std::endl;
   std::cout<<a; /*to print logical address of the array a */
   return 0;
}

output :

Enter the elements of the array
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
0x6ffdf0
--------------------------------

Add a comment
Know the answer?
Add Answer to:
Write a C++ program IN VISUAL STUDIO CODE that will display the value and logical address...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT