Question

Write in c and in the simplest form (beginner) Write a program pointers with multi-dimensional integer...

Write in c and in the simplest form (beginner)

Write a program pointers with multi-dimensional integer array [2] [4]. Use data set {#,88,89,90},{?,65,66,67}.

Now the input characters would be converted to ASCII decimal value and put into the first cell of the row’s array, and so on.

When getting the values out of the array, convert the decimal value to equivalent ASCII character.

Print the address of the first array followed by the four decimal values, followed by the four characters of their ASCII decimal value. Do the same for the second row. All values to be place and gotten be pointer.  

<END

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1 #include <stdio.h> 3 int main(void) { clang version 7.0.0-3-ubuntu. 18.04.1 (tags/RELE } clang-7 -pthread -LM -o main main.

#include <stdio.h>

int main(void) {

        int data[2][4] = {
                {'#', 88, 89, 90},
                {'?', 65, 66, 67}
        };

        printf("First row address: %p \nData: ", &data[0]);
        for(int i=0; i<4; i++) {
                printf("%c ", data[0][i]);
        }
        printf("\n");

        printf("Second row address: %p \nData: ", &data[1]);
        for(int i=0; i<4; i++) {
                printf("%c ", data[1][i]);
        }
        printf("\n");

        return 0;
}


Hi. Please find the answer above.. In case of any doubts, you may ask in comments. You may upvote the answer if you feel i did a good work!

Add a comment
Know the answer?
Add Answer to:
Write in c and in the simplest form (beginner) Write a program pointers with multi-dimensional integer...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write in C. Simple Program (beginner) Assignment: Write a program Character Pointers and Functions. (like program...

    Write in C. Simple Program (beginner) Assignment: Write a program Character Pointers and Functions. (like program #5-5). Keyboard input to enter one character string. Using a single dimension array, populate the array with the character string, call a function using pointers to reverse order the character string, pass back to the main the output and total_count_of_characters. (maybe use a global variable for the total count). Print display the reversed char string and total_count. <END>

  • In C: Write a function "MinMax" that takes as an argument an integer array, an integer...

    In C: Write a function "MinMax" that takes as an argument an integer array, an integer for the size of the array, and two integer pointers. The function should print nothing and return nothing but change the value of the first pointer to the minimum value in the array and change the value in the second pointer to the max value in the array.

  • Pointer tasks: ( In C++ ) 1. Write a program to store the address of a...

    Pointer tasks: ( In C++ ) 1. Write a program to store the address of a character variable and a float variable. • Print the address of both variables. • Print the values of variable using dereference operator. • Add 2 in float value using pointer. • Print address of character variable using reference operator. 2. Write a program that takes 5 elements in an array and print them in reverse order using pointers. 3. Write to program that takes...

  • Write a program that deletes an element of a one-dimensional array of characters. The program should:...

    Write a program that deletes an element of a one-dimensional array of characters. The program should: Ask user to input the number of characters in the array the values of the array a character to be deleted Call a method to delete the character Print the resulting array or, if the character is not found, print “Value not found” The method called by the main program should: Pass the array and the character to be found as parameters If the...

  • Question 16 (4 points) Write a complete C program that declares four variables of type integer...

    Question 16 (4 points) Write a complete C program that declares four variables of type integer (i.e integer variables) and four variables of type pointer to integer (i.e. integer pointers). Assign the addresses into the pointers. Using the indirection operator with a pointer, assign the values 1, 2, 3, and 4 into the four integers. (Use the indirection operator with the pointers to write the integer values.) Your program should write the addresses and values of all eight variables to...

  • In basic c develop the code below: (a) You will write a program that will do...

    In basic c develop the code below: (a) You will write a program that will do the following: prompt the user enter characters from the keyboard, you will read the characters until reading the letter ‘X’ You will compute statistics concerning the type of characters entered. In this lab we will use a while loop. We will read characters from stdin until we read the character ‘X’. Example input mJ0*5/]+x1@3qcxX The ‘X’ should not be included when computing the statistics...

  • Need help with these, especially number 4. C++ program L. WIite the function Write a function...

    Need help with these, especially number 4. C++ program L. WIite the function Write a function mpgcalculator that accepts pointers to three arrays. The firstis an array of miles, the second is an array of gallons, the third will hold mile-per-gallon. It has no return value. 4. a. b. c. d. write the prototype call this function with these three arrays: miles, gallons, mpg. write the function use only array notation 5. Do #4, using only array with offset notation....

  • C++ Program - Arrays- Include the following header files in your program:     string, iomanip, iostream Suggestion:...

    C++ Program - Arrays- Include the following header files in your program:     string, iomanip, iostream Suggestion: code steps 1 thru 4 then test then add requirement 5, then test, then add 6, then test etc. Add comments to display assignment //step 1., //step 2. etc. This program is to have no programer created functions. Just do everything in main and make sure you comment each step. Create a program which has: 1. The following arrays created:                 a. an array...

  • in java Original: Sound Visualization Write a program that uses StdAudio and Picture to create an...

    in java Original: Sound Visualization Write a program that uses StdAudio and Picture to create an interesting two-dimensional color visualization of a sound file while it is playing. Be creative! Additional Notes: double[] data = StdAudio.read(<filename>); -> Takes a sound file and store it as a 2D array of real numbers. Picture pic = new Picture(300,200); -> Creates a picture 300 pixels wide and 200 pixels high Color c= new Color(<red>,<green>,<blue>); -> Each value of <red>, <green>, <blue> is between...

  • Please code in c 1. Write a program which does the following: Declare and initialize three...

    Please code in c 1. Write a program which does the following: Declare and initialize three pointers. One points to an integer, one points to a float and one points to a character variable Ask the user to enter appropriate values for these variables. Output the values to the screen by accessing the variables directly and then by using pointer references. Print the address of each variable. Modify the variables by performing any arithmetic operation only using pointer refer- ences...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT