this program is to be done in c language. Using Pointers Create a program pointerTester.c to...

90.2K

Verified Solution

Question

Electrical Engineering

this program is to be done in c language. Using Pointers Createa program pointerTester.c to experiment with pointers. Implementthe following steps one by one in your program: YOU NEED TO ANSWERQUESTION Use printf to print your answers at the end(after 12). 1.Declare three integer variables a, b and c. Initialize them to 0,100 and 225, respectively. 2. Print the value of each variable andits address. 3. Add the following declaration to your code: int *pA= &a, *pB = &b, *p; 4. Print the value of each pointer andthe value it points to (using the pointer) 5. Run your programmultiple times. a. Does any of the values *pA, *pB or *p change? b.Does any of the values pA, pB or p change? 6. Change the value thatp points to to 50 without declaring the valuable that p points to.Can you print the value that p points to? 7. Declare an array z of10 integers and initialize its elements to 0, 1, 2, …., 9 8. Printthe address of each element in the array using the z[i] notation 9.Print the address of each element in the array using the z + inotation 10. Print the content of the array using z + i notation11. Declare a string literal x and set it to value “hello”. 12.Change the second character of x to upper case. What happens?Strings Write a program reading.c that reads from standard inputaccording to the user’s choice. The program should ask “How wouldyou like to read?” 1: character by character; 2: word by word; 3:line by line. Default: print “Invalid choice”. You should write thethree procedures below. - The procedure readCharByChar asks theuser to enter 5 characters and read them (hint: using %c). - Theprocedure readWordByWord asks the user to enter 5 words and readthem (hint: using %s). - The procedure readLineByLine should askthe user to enter 5 lines and read them (hint: using gets). In eachof the three procedures, the values read should be printed to thescreen, each on a separate line showing: input index, tab, unit(char, word, or line). According to the user choice, your programuses a switch statement to call readCharByChar, readWordByWord, andreadLineByLine, respectively. Make sure your code is properlyindented, your variables have meaningful names, and macrodefinitions are used when appropriate.

Answer & Explanation Solved by verified expert
4.0 Ratings (720 Votes)
Refer to the given problemConsider the following c language programC programinclude int main 1 Declaring a b and c integer variables Now initializingthe integer to 0 100 and 225 respectivelyint abca 0b 100c 225 2 Printing each variable value ab and c and itsaddressprintfVariable a d and addrress is un aaprintfVariable b d and addrress is un    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students