In: Computer Science
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);
}
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