answersLogoWhite

0

What would a array of 18 look like?

Updated: 12/22/2022
User Avatar

Wiki User

11y ago

Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: What would a array of 18 look like?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What multiplication fact can be found by using the arrays for 2x9 and 5x9?

The multiplication fact (singular, not plural 'facts') that can be found is 7x9 = 63. Using the arrays, a 2x9 array (2 rows of 9 items) and 5x9 array (5 rows of 9 items) is 63: 2x9 = 18 5x9 = 45 18 + 45 = 63


What is a C plus plus program to change 5x5 array to 1x25 array?

An array is simply a contiguous block of memory. The length of that memory is the product of all its dimensions multiplied by the size of its type. Thus a 5x5 array is exactly the same as a 1x25 array. The only difference is in how you refer to each element. The following code demonstrates how we can remap a 5x5 array to a 1x25 array, simply by pointing at the first element. Note that we haven't actually changed the array, nor have we copied it to new memory. We're simply interpreting the exact same memory in two different ways. #include<iostream> #include<iomanip> int main() { int x[5][5] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }; // treat as 5x5 array: for (int a=0; a<5; ++a) { for (int b=0; b<5; ++b) { std::cout<<std::setw (3)<<x[a][b]; } std::cout<<'\n'; } std::cout<<std::endl; // treat as one-dimensional array (remap) int* y = x[0]; for (int c=0; c<25; ++c) std::cout<<std::setw (3)<<y[c]; std::cout<<'\n'<<std::endl; } Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25


What are the syntax for one dimensional array in c plus plus?

type_of_data array_name[number_of_elements_ in_array];For instance,int myArray[10];It creates array of type int, and array consists of 10 elements.


Write a program that will arrange the elements of a 10-integer array in ascending and descending order?

import java.io.*; public class descendingorder { public static void main(String args[]) throws IOException { BufferedReader in= new BufferedReader(new InputStreamReader(System.in)); int i,j,n,t; int a[]=new int[20]; System.out.println("Enter the number of elements:"); n=Integer.parseInt(in.readLine()); System.out.println("Enter the elements of the array:"); for(i=0;i<n;i++) { a[i]=Integer.parseInt(in.readLine()); } for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(a[i]>a[j]) { t=a[i]; a[i]=a[j]; a[j]=t; ] } } System.out.println("The orderer lit..."); { for(i=0;i<n;i++) { System.out.println(a[i]); } } }


Write a program to detect duplicate elements in array?

The simplest way of doing this is not very efficient, but provides a quick development time. You want to take all of the elements of the array, add them to a Set, then retrieve them as an array again. Note that this will probably not preserve the order of elements in the array. { Object[] originalArray; // let's pretend this contains the data that // you want to delete duplicates from Set newSet = new HashSet(); for (Object o : originalArray) { newSet.add(o); } // originalArray is now equal to the array without duplicates originalArray = newSet.toArray(); } Now the efficient, and more correct, solution. This one will create a new array of the correct size without duplicates. { Object[] originalArray; // again, pretend this contains our original data // new temporary array to hold non-duplicate data Object[] newArray = new Object[originalArray.length]; // current index in the new array (also the number of non-dup elements) int currentIndex = 0; // loop through the original array... for (int i = 0; i < originalArray.length; ++i) { // contains => true iff newArray contains originalArray[i] boolean contains = false; // search through newArray to see if it contains an element equal // to the element in originalArray[i] for(int j = 0; j <= currentIndex; ++j) { // if the same element is found, don't add it to the new array if(originalArray[i].equals(newArray[j])) { contains = true; break; } } // if we didn't find a duplicate, add the new element to the new array if(!contains) { // note: you may want to use a copy constructor, or a .clone() // here if the situation warrants more than a shallow copy newArray[currentIndex] = originalArray[i]; ++currentIndex; } } // OPTIONAL // resize newArray (using _newArray) so that we don't have any null references Object[] _newArray = new Object[currentIndex]; System.arraycopy(newArray, 0, _newArray, 0, currentIndex); }

Related questions

What is bigger 18 percent or 0.7?

0.7 as this is 70%


What is the number quintillion?

Since a quintillion has 18 zeros; one quintillion would look like this: 1,000,000,000,000,000,000


What is a pointer in the array?

A pointer into an array of elements of type E is a pointer to a single element of type E:typedef ..... E;E array[123];E* const pointer = &array[18]; // points to the 19th element inside 'array'An array of pointers is an array whose elements are pointers:typedef .... E;E* array[123];E** const pointer = &array[18]; // points to the 19th pointer within 'array'Referencing the name of the array variable without use of the index operator itself is a constant pointer to its first element. Therefore, the following if-clause is always true:typedef .... E;E array[123];if (array &array[N]) { // ALWAYS true ...}


What does a factor tree for the number 18 look like?

18 9,2 3,3,2


What does 6 18 look like in decimal form?

6/18 = 0.33...


What will I look like when I’m 18?

You wi look like a singer.


What does 18 5ths look like as a mixed number?

18/5 = 33/5


Can i give you a picture and you morph it and so i can see what i would look like when i turn 18?

this site can do this: http://morph.cs.st-andrews.ac.uk//Transformer/


What does a wishbone look like?

The wishbone looks like the anti-twisting device from the Hobie 18


What do roman numerals look like 1 8?

18 in roman numerals looks like XVIII


What does 6x3 equal?

6x3=18


Does Taylor Lautner have children?

Taylor Lautner has no children. he is an awesome actor and is not that stupid to have children at 18. it would kinda ruin his akting life. he would have to help look after the child. he could be like brad pit but it would be hard.