Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include int main () { int age = 40; float gpa = 3.25; char grade = 'A'; double x = 0.000009; char companyName[20]; printf(Address of

image text in transcribed
#include int main () { int age = 40; float gpa = 3.25; char grade = 'A'; double x = 0.000009; char companyName[20]; printf("Address of age: %d ", &age); printf("Size of age: %lu ", sizeof(age)); printf("Address of GPA: %d ", &gpa); printf("Size of age: %lu ", sizeof(gpa)); printf("Address of grade: %d ", &grade); printf("Size of grade: %lu ", sizeof(grade)); printf("Address of x: %d ", &x); printf("Size of x: %lu ", sizeof(x)); printf("Address of companyName: %d ", &companyName); printf("Size of companyName: %lu ", sizeof(companyName)); int *pAge; pAge = &age; float *pGpa; pGpa = &gpa; char * pGrade; pGrade = &grade; double &pX; pX = &x; char *pCompanyName; pCompanyName = &companyName; printf(" Value of Age though pointer: %d", *pAge); printf(" Value of GPA though pointer: %0.2f", *pGpa); printf(" Value of Grade though pointer: %c", *pGrade); printf(" Value of X though pointer: %f", *pX); printf(" Value of CompanyName though pointer: %p ", *pCompanyName); printf(" The address from Age pointer: %p", pAge); printf(" The address from Gpa pointer: %p", pGpa); printf(" The address from Grade pointer: %p", pGrade); printf(" The address from X pointer: %p", pX); printf(" The address from CompanyName pointer: %p ", pCompanyName); *pAge += 5;//Added 5 to Age through pointer. Printf(" Value of Age: %d", age); printf(" Value of Age through pointer: %d", *pAge); return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions