Question

Ctrl CSC 270 Final Exam-Spring2 1) [10 pts] Create anarray x which includes integers fron ltos obtain the array y which, even need question 3 assap using cin and cout outputs please
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Executable code:

#include <iostream>
using namespace std;

int main() {
   // your code goes here
   int a,b; //initializing a and b
   cin>>a>>b; //taking input of a and b
   int *pointer1, *pointer2; //initializing pointers
   //assigning values to pointers
   pointer1 = &a;
   pointer2 = &b;
   //printing values and addresses
   cout<<"value of a= "<<a<<"\nmemory address of a= "<<&a<<endl;
   cout<<"value of b= "<<b<<"\nmemory address of b= "<<&b<<endl;
   cout<<"value at pointer1="<<*pointer1<<endl;
   cout<<"nmemory address of pointer1= "<<&pointer1<<endl;
   cout<<"value at pointer2="<<*pointer2<<endl;
   cout<<"nmemory address of pointer2= "<<&pointer2<<endl;
   return 0;
}

output:

value of a= 1
memory address of a= 0x7ffc6a1f0338
value of b= 2
memory address of b= 0x7ffc6a1f033c
value at pointer1=1
nmemory address of pointer1= 0x7ffc6a1f0340
value at pointer2=2
nmemory address of pointer2= 0x7ffc6a1f0348

Running code screenshot :

12 <stdio.h> include 13 14 void DoIt( int n) 15 if( n.. 0 ) 16 printf( DoneIn) else DoIt( n/2) printf(%d\n, n ); 20 21 23

Hope this helps!
Kindly appreciate the help by upvoting the answer. Thank you!

Add a comment
Know the answer?
Add Answer to:
need question 3 assap using cin and cout outputs please Ctrl CSC 270 Final Exam-Spring2 1) [10 pts] Create anarray x which includes integers fron ltos obtain the array y which, even formula. Displ...
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
ADVERTISEMENT