{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lab 4 work - M E 218(17795 Alan Shu-M ing Kwok(sk25784...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ME 218 (17795) Alan Shu-Ming Kwok (sk25784) Problem 2.1 pointers. (pointers_yourUTEID.c or pointers_yourUTEID.cpp) Write a program that contains an int ‘zip’ and stores your zip code. Create a pointer ‘zipPtr’ to the variable ‘zip.’ Output to the screen the value of the variable both directly and by dereferencing the pointer. Also, output the address where the pointer is stored by determining the address of the variable using an Ampersand and the contents of ‘zipPtr.’ Turn in a copy of your code and a screen shot that contains the outputs. Problem 2.2 arrays (arrays_yourUTEID.c or arrays_yourUTEID.cpp) Write a program that constructs an array with 6 integer elements. Assign the first element to the value 2.. Then assign, using a ‘ for’ loop, the remaining elements a value that is double the previous element. Turn in a copy of your code and a screen shot of your results.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ME 218 (17795) Alan Shu-Ming Kwok (sk25784) Problem 2.3 Strings (strings_yourUTEID.c or strings_yourUTEID.cpp)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 4

lab 4 work - M E 218(17795 Alan Shu-M ing Kwok(sk25784...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online