This is my C++ Codes for the problem but it has errors when I run it. Can you fix the errors? Please still use header files iostream. This is a topic under Data Structures: Arrays. //Start of program...


This is my C++ Codes for the problem but it has errors when I run it. Can you fix the errors? Please still use header files iostream. This is a topic under Data Structures: Arrays.


//Start of program
#include
#define TRUE 0
#define FALSE 1


using namespace std;


int main()
{
//Declaration of array

int A[50];


//Display the first element of the array A
cout < "the="" value="" of="" the="" first="" element="" of="" the="" array="" a="" is:="" "="">< a[0]=""><>


//Store the value 26 in 25th element of array A
A[24] = 26;


//Store the computed value in 10th element of array A
A[9] = (A[39] * 3) + 10;
cout < "the="" value="" of="" the="" 10th="" element="" of="" the="" array="" a="" is:="" "="">< a[9]=""><>


int n = 0; //Subscript of array A


//For loop
for (int i = 0; i < n;="">
{
if (n / 2 == 0 || n / 3 == 0) //If subscript is a multiple of 2 or 3
{
cout < a[i]="">< "="" "="">< endl;="" display="" the="" value="" of="" an="" element="" of="" array="">
}


if (n / 2 != 0 || n / 3 != 0) //If subscript is not a multiple of 2 or 3
break; //Break out of loop
}


//End of program
return 0;
}


Write a program that will read in N integers from keyboard input into an array. The size of<br>the array N will be entered on the keyboard. The program will tabulate the output as shown<br>below: the first column should show the list of distinct array elements sorted in ascending<br>order, while the second column should show the number of occurrences of each element.<br>Sample input: 9, 15, 7, 9, 3, 7, 3, 3,7, 6, 3, 20<br>Expected output:<br>count<br>3.<br>4<br>6<br>1<br>7<br>3<br>15<br>1<br>20<br>1<br>

Extracted text: Write a program that will read in N integers from keyboard input into an array. The size of the array N will be entered on the keyboard. The program will tabulate the output as shown below: the first column should show the list of distinct array elements sorted in ascending order, while the second column should show the number of occurrences of each element. Sample input: 9, 15, 7, 9, 3, 7, 3, 3,7, 6, 3, 20 Expected output: count 3. 4 6 1 7 3 15 1 20 1
Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here