Example of array, C/C++ Programming

In this lab, please complete a given program to perform the following tasks:

1. Allocate a 10 by 5 2D byte array dynamically. The way of allocation must be consistent with page 39 in chap9.ppt. Each element is a byte.

2. For each element in the array, assign a random number. The range does not matter.

3. Display the array.

4. Exchange the rows as defined below:

Row 0 becomes Row 9

Row 1 becomes Row 0

Row 2 becomes Row 1

Row 3 becomes Row 2

Row 4 becomes Row 3

Row 5 becomes Row 4

Row 6 becomes Row 5

Row 7 becomes Row 6

Row 8 becomes Row 7

Row 9 becomes Row 8

Please swap the values, instead of just the pointers.

5. Display the array.

You are required to finish the given program, "TwoDArray_lab6.asm", without adding new variables. The output may look like:

1823_output.png

Posted Date: 3/14/2013 5:58:00 AM | Location : United States







Related Discussions:- Example of array, Assignment Help, Ask Question on Example of array, Get Answer, Expert's Help, Example of array Discussions

Write discussion on Example of array
Your posts are moderated
Related Questions
Problem: (a) Show the Java approach to event processing by explaining how event handling works in Java. Make use of a suitable example to support your answer. (b) Describe

Converting Base Type to Class Type (char to string)   class String { char *name; int length; public: String(void) {length =0; name = new char[length+1];

A PROGRAM TO CALCULATE AREA OF TRIANGLE

A: No. There is nothing you can do in C++ which you cannot do in C. In spite of everything

when you allocate memory with new[], you ought to free the memory via delete[]. While you allocate memory along 'new', then use 'delete' with no the brackets. You employ new[] to a

What is the difference between JavaScript and PHP? The difference lies with the execution of languages. PHP is server side scripting language, which means that it cannot intera

Receive 3 numbers and display them in ascending order from smallest to largest ed#

Q-What happens while a function throws an exception which was not specified through an exception specification for this function? A: Unexpected() is called, which, by default, w

write a program for convert numbers upto 9 to alphabet?Eg.now enter the inputis 666 means output is "0" lphabet

write a pseudocode algorithm for a program that accepts a number and prints out its reciprocal(1/n) is required.the program should prevent the user from entering zero by asking t