Solution for Exercise 18-14
ex1814
#include <stdio.h> int main() { int age; float weight; int *a; float *w; a = &age; // Initialize the pointers w = &weight; *a = 43; // Set the values using *w = 217.6; // the pointers printf("You are %d years old\n",age); printf("And you weigh %.1f pounds.\n",weight); return(0); }
Notes
* The whole age/weight thing isn't a requirement for successful completion of this exercise. As long as you declared an int and float and corresponding pointers, you're good.
Copyright © 1997-2024 by QPBC.
All rights reserved