I. Create a function main() and do the following sequence of instructions: 1. Declare two integer variables x and y. 2. Declare two pointer variables p and q. 3. Assign the following values: x-15, y=25. 4. Print the values of x and y. 4. Let the pointer p points to the address of x 5. Print the value of x and the address of x using the pointer variable p 6. Increment the value of x by 5 using the pointer variable p 7. Print the value of x (using x and p variables) 8. Let the pointer variable q points to the address of y. 9. Print the value of y and the address of y using the pointer variable q. 10. Add the value of x to the value stored in y using their pointer variables p and q. 11. Print the new values of x and y using the pointer variables p and q. 12. Let pointer p points to the address where the pointer q also points. 13. Print the address of the variable pointed to by p and q. 14. Change the value of y (let y=50) using the pointer p 15. Print the value of x and y (using their variable names) 16. Print the values pointed by p and q. Sample Output if Applicable CA Z:ICCS122-1L13FBC-1\EXER12.EXE X-15 and y-25 Value of x-15 and address of x-ffca New value of x-20, x-20 Ualue of y-25 and address of y-ffcc New value of x-20 and y-45 The address of x-ffcc and y-ffcc The value of x-20 and y-50 The value of x-50 and y-50_
I. Create a function main() and do the following sequence of instructions: 1. Declare two integer variables x and y. 2. Declare two pointer variables p and q. 3. Assign the following values: x-15, y=25. 4. Print the values of x and y. 4. Let the pointer p points to the address of x 5. Print the value of x and the address of x using the pointer variable p 6. Increment the value of x by 5 using the pointer variable p 7. Print the value of x (using x and p variables) 8. Let the pointer variable q points to the address of y. 9. Print the value of y and the address of y using the pointer variable q. 10. Add the value of x to the value stored in y using their pointer variables p and q. 11. Print the new values of x and y using the pointer variables p and q. 12. Let pointer p points to the address where the pointer q also points. 13. Print the address of the variable pointed to by p and q. 14. Change the value of y (let y=50) using the pointer p 15. Print the value of x and y (using their variable names) 16. Print the values pointed by p and q. Sample Output if Applicable CA Z:ICCS122-1L13FBC-1\EXER12.EXE X-15 and y-25 Value of x-15 and address of x-ffca New value of x-20, x-20 Ualue of y-25 and address of y-ffcc New value of x-20 and y-45 The address of x-ffcc and y-ffcc The value of x-20 and y-50 The value of x-50 and y-50_
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
100%
Make a C program.
![• To learn how to use pointers
• To know what pointers are
• To learn how to declare pointers
Understand the meaning of the ampersand & symbol
• Understand the meaning of the asterisk * symbol
To understand the concept and use of pointers
• To be able to declare, define, and initialize pointers
• To write programs that access data through pointers
To use pointers as parameters and return types
Objectives:
Description
I. Create a function main() and do the following sequence
of instructions:
1. Declare two integer variables x and y.
2. Declare two pointer variables p and q.
3. Assign the following values: x-15, y=25.
4. Print the values of x and y.
4. Let the pointer p points to the address of x
5. Print the value of x and the address of x
using the pointer variable p
6. Increment the value of x by 5 using the pointer
variable p
7. Print the value of x (using x and p variables)
8. Let the pointer variable q points to the address
of y.
9. Print the value of y and the address of y using
the pointer variable q.
10. Add the value of x to the value stored in y using
their pointer variables p and q.
11. Print the new values of x and y using the pointer
variables p and q.
12. Let pointer p points to the address where the pointer
q also points.
13. Print the address of the variable pointed
to by p and q.
14. Change the value of y (let y=50) using the
pointer p
15. Print the value of x and y (using their variable names)
16. Print the values pointed by p and q.
Sample Output if Applicable
GA Z:ICCS122-1L13FBC-1\EXER12.EXE
x-15 and y 25
Ualue of x 15 and address of xffca
New value of x-20, x-20
Ualue of y-25 and address of y-ffcc
New value of x-20 and y-45
The address of x-ffcc and y-ffcc
The value of x-20 and y-50
The value of x-50 and y-50_](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5efc91db-db7b-479e-abbb-a1d3ad98ded0%2Fb0a2c7ba-22ed-4e4a-a924-7254027d85f8%2Fnp5gohm_processed.jpeg&w=3840&q=75)
Transcribed Image Text:• To learn how to use pointers
• To know what pointers are
• To learn how to declare pointers
Understand the meaning of the ampersand & symbol
• Understand the meaning of the asterisk * symbol
To understand the concept and use of pointers
• To be able to declare, define, and initialize pointers
• To write programs that access data through pointers
To use pointers as parameters and return types
Objectives:
Description
I. Create a function main() and do the following sequence
of instructions:
1. Declare two integer variables x and y.
2. Declare two pointer variables p and q.
3. Assign the following values: x-15, y=25.
4. Print the values of x and y.
4. Let the pointer p points to the address of x
5. Print the value of x and the address of x
using the pointer variable p
6. Increment the value of x by 5 using the pointer
variable p
7. Print the value of x (using x and p variables)
8. Let the pointer variable q points to the address
of y.
9. Print the value of y and the address of y using
the pointer variable q.
10. Add the value of x to the value stored in y using
their pointer variables p and q.
11. Print the new values of x and y using the pointer
variables p and q.
12. Let pointer p points to the address where the pointer
q also points.
13. Print the address of the variable pointed
to by p and q.
14. Change the value of y (let y=50) using the
pointer p
15. Print the value of x and y (using their variable names)
16. Print the values pointed by p and q.
Sample Output if Applicable
GA Z:ICCS122-1L13FBC-1\EXER12.EXE
x-15 and y 25
Ualue of x 15 and address of xffca
New value of x-20, x-20
Ualue of y-25 and address of y-ffcc
New value of x-20 and y-45
The address of x-ffcc and y-ffcc
The value of x-20 and y-50
The value of x-50 and y-50_
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY