×
BLUE
Arrays in C++


Arrays in C++
  7 April 2021
Read more Like this Post.
An array is a collection of elements of the same type placed in contiguous memory locations that can be individually referenced by using an index to a unique identifier.
An array is a collection of elements of the same type placed in contiguous memory locations that can be individually referenced by using an index to a unique identifier. Five values of type int can be declared as an array without having to declare five different variables (each with its own identifier).
#include 
using namespace std;
int arrayA[10] = {11, 22, 33, 44, 55, 66, 77, 88, 99, 10};
int arrayB[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
int multiplyer;
int main(){
    for(int i = 0; i < 10; i++){
        multiplyer = arrayA[i] * arrayB[i];
        cout << "array a element: " << arrayA[i] << " * " << "array b element: " << arrayB[i] << " = " << multiplyer << endl;
    }
}
this is two arrays and multiplying by each other in a loop;
Related Post's

Cpp   arrays   functions   classes    
Not Loaded Zohaib Jozvi
0 7 April 2021
Read Latest Post.
Read other post.