Successfully reported this slideshow.
Your SlideShare is downloading. ×

write a c++ program to create an inches vector from 0 to 120 with an i.docx

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 2 Ad

write a c++ program to create an inches vector from 0 to 120 with an i.docx

Download to read offline

write a c++ program to create an inches vector from 0 to 120 with an increment of 10 create the corresponding values of feet. then group the two vectors together into a table matrix
Solution
Please find the required solution:
#include <iostream>
#include <vector>
using namespace std;

int main()
{
// create a vectors to store inches,feet
vector<int> inches,feet;

//matrix to store
int inchesFeet[120][2];
int i;
// push 120 values into the inches,feet vectors
for(i = 0; i < 120; i++){
inches.push_back(i);
feet.push_back(i+10);
}
// convert to table matrix
for(i = 0; i < 120; i++){
inchesFeet[i][0]=inches[i];
inchesFeet[i][1]=feet[i];
}

//print test result
for(i=0;i<10;i++)
{
cout<<inchesFeet[i][0]<<\" \"<<inchesFeet[i][1]<<endl;
}
return 0;
}
.

write a c++ program to create an inches vector from 0 to 120 with an increment of 10 create the corresponding values of feet. then group the two vectors together into a table matrix
Solution
Please find the required solution:
#include <iostream>
#include <vector>
using namespace std;

int main()
{
// create a vectors to store inches,feet
vector<int> inches,feet;

//matrix to store
int inchesFeet[120][2];
int i;
// push 120 values into the inches,feet vectors
for(i = 0; i < 120; i++){
inches.push_back(i);
feet.push_back(i+10);
}
// convert to table matrix
for(i = 0; i < 120; i++){
inchesFeet[i][0]=inches[i];
inchesFeet[i][1]=feet[i];
}

//print test result
for(i=0;i<10;i++)
{
cout<<inchesFeet[i][0]<<\" \"<<inchesFeet[i][1]<<endl;
}
return 0;
}
.

Advertisement
Advertisement

More Related Content

More from lez31palka (20)

Recently uploaded (20)

Advertisement

write a c++ program to create an inches vector from 0 to 120 with an i.docx

  1. 1. write a c++ program to create an inches vector from 0 to 120 with an increment of 10 create the corresponding values of feet. then group the two vectors together into a table matrix Solution Please find the required solution: #include <iostream> #include <vector> using namespace std; int main() { // create a vectors to store inches,feet vector<int> inches,feet; //matrix to store int inchesFeet[120][2]; int i; // push 120 values into the inches,feet vectors for(i = 0; i < 120; i++){ inches.push_back(i); feet.push_back(i+10); } // convert to table matrix for(i = 0; i < 120; i++){ inchesFeet[i][0]=inches[i]; inchesFeet[i][1]=feet[i]; } //print test result for(i=0;i<10;i++) { cout<<inchesFeet[i][0]<<" "<<inchesFeet[i][1]<<endl;
  2. 2. } return 0; }

×