0% found this document useful (0 votes)
21 views1 page

Struct

This C++ program defines two 2D arrays, x and y, where x contains sample data and y is empty. A nested for loop iterates through x, multiplying each element by 2 and storing the result in the corresponding element of y. Each new element of y is then outputted to the console.

Uploaded by

AdheShenza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

Struct

This C++ program defines two 2D arrays, x and y, where x contains sample data and y is empty. A nested for loop iterates through x, multiplying each element by 2 and storing the result in the corresponding element of y. Each new element of y is then outputted to the console.

Uploaded by

AdheShenza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<iostream.

h>
void main ()
{
int x[2][3]={{2,3,1},{3,5,2}};
int y[2][3];
int i,n;
for(i=0;i<=1;i++)
{
for(n=0;n<=2;n++)
{
y[i][n]=x[i][n]*2;
cout<<y[i][n]<<"\t";
}
}
}

You might also like