Question

In: Computer Science

open the program you created from page 31 into geany (change main's definition like in module...

  • open the program you created from page 31 into geany (change main's definition like in module 1)
  • modify the program to show values and memory locations of the variable "a" from 5 through 20 (you will need to use a loop of some sort
  • build and run your program
  • open another tab in geany, load in the program from page 34 (change main's definition like in module 1)
  • modify the program to cast vptr as a float and as a double
  • build and run your program

THIS IS THE PROGRAM CODE:

#include <stdio.h>

void main (void)

{

int a;

int *ptr_to_a;

ptr_to_a = &a;

a = 5;

printf ("The value of a is %d\n", a);

*ptr_to_a = 6;

printf ("The value of a is %d\n", a);

printf ("The value of ptr_to_a is %d\n", ptr_to_a);

printf ("It stores the value %d\n", *ptr_to_a);

printf ("The address of a is %d\n", &a);

}

Solutions

Expert Solution

To show values and memory locations of the variable "a" from 5 through 20 we can use any loop out of for,while and do while.In this solution I am using for loop.

OUTPUT


Related Solutions

1. What benefits result from a co-created, shared definition of change success? In regards to Organizational...
1. What benefits result from a co-created, shared definition of change success? In regards to Organizational Development
Language: c++ using visual basic Write a program to open a text file that you created,...
Language: c++ using visual basic Write a program to open a text file that you created, read the file into arrays, sort the data by price (low to high), by box number (low to high), search for a price of a specific box number and create a reorder report. The reorder report should alert purchasing to order boxes whose inventory falls below 100. Sort the reorder report from high to low. Inventory data to input. Box number Number boxes in...
Present a screenshot of the following Program to open up the created file in C++ language....
Present a screenshot of the following Program to open up the created file in C++ language. The list of random numbers will be below the instructions I have provided for you a file named Random.txt for use in this program. This file contains a long list of random numbers. You are to write a program that opens the file, reads all the numbers from the file and calculates the following: A. The number of numbers in the file B. The...
Revisit the picture of leadership you created in the first module. Contrast your picture of leadership...
Revisit the picture of leadership you created in the first module. Contrast your picture of leadership with the description of transformational leadership in the readings. Has your picture of leadership changed? In what ways?Consider these changes for a moment: are they based on behavior, thinking, or worldview? How might these changes support or overturn assumptions or perceptions of transformative leadership?
For this activity, you will select one of the four module objectives from the Module 8...
For this activity, you will select one of the four module objectives from the Module 8 Overview and Objectives page 1. Analyze International Trade Theory. 2. Examine trade restrictions and their effectiveness. 3. Discuss the foreign exchange market. 4. Distinguish between fixed and flexible exchange rate systems. Your presentation is required to be narrated and at maximum be five minutes in length. Here are your required slides: Title Slide Introductory Slide Content Slide Summary/Conclusion Slide Reference Slide
Authentic Assessment for Module 4: Job Costing Please go to the Excel Workbook you created for...
Authentic Assessment for Module 4: Job Costing Please go to the Excel Workbook you created for the Module 2 Authentic Assessment. If you need to, create a new tab and name it “Module 4 Entries” – this is where you will provide in good form the journal entries for the assessment and determine job costs. Use the number of the item instead of a date and do include a brief description. Your journal entries need to be formatted and indented...
Instructions: Format each of your Answers as follows: (A) Definition (quote from the Textbook, with page...
Instructions: Format each of your Answers as follows: (A) Definition (quote from the Textbook, with page number, OR quote from another permitted source -- i.e. an online law dictionary, with proper source citation ) (B) Explanation in your own words (C) Example (either your own, OR one that is in the Text, OR one that is in another permitted source, with proper source citation) (D) Find a website that supports and further explains your answer (not one that I have...
This program focuses on programming with Java Collections classes. You will implement a module that finds...
This program focuses on programming with Java Collections classes. You will implement a module that finds a simplified Levenshtein distance between two words represented by strings. Your program will need support files LevenDistanceFinder.Java, dictionary.txt, while you will be implementing your code in the LevenDistanceFinder.java file. INSTRUCTIONS The Levenshtein distance, named for it's creator Vladimir Levenshtein, is a measure of the distance between two words. The edit distance between two strings is the minimum number of operations that are needed to...
INSTRUCTION: Use “OptAll” program for the following questions. When you open “OptAll” program, be sure you...
INSTRUCTION: Use “OptAll” program for the following questions. When you open “OptAll” program, be sure you enable macro. The tabs of the worksheets indicate the corresponding option pricing models or exotic options. As demonstrated in the past two classes, the “OptAll” program is fairly straight forward to use. Enter the required inputs and the results will be automatically calculated. We have studied these options in Module 3. You may (and should) apply the “OptAll” program to the previous Module 3...
Created a chart (any way you would like) include in the chart if the media is...
Created a chart (any way you would like) include in the chart if the media is selective,differential,enrichment-any special characteristics,what is it used for identification,what are the possible results (and any color changes or any other ingredients needed to analyze)and what are the interpretations of those results.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT