You are on page 1of 2

#include <conio.

h>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
float vetorA[6], vetorB[6], vetorC[6], vetorD[6];
int j;
cout<<"\nDigite os 6 numeros do vetorA\n";
for(j=0;j<6;j=j+1)
{
cin>>vetorA[j];
}
cout<<"\nDigite os 6 numeros do vetorB\n";
for(j=0;j<6;j=j+1)
{
cin>>vetorB[j];
}
for(j=0;j<6;j++)
{
if(vetorA[j]<vetorB[j])
vetorC[j]=vetorA[j];
else vetorC[j]=vetorB[j];
}
for(j=0;j<6;j++)
{
if(vetorA[j]>vetorB[j])
vetorD[j]=vetorA[j];

else vetorD[j]=vetorB[j];
}
for(j=0;j<6;j++)
{
if(vetorA[j]==vetorB[j])
vetorD[j]=0;
}
cout<<"\n\nvetorA

vetorB

vetorC

vetorD\n";

for(j=0;j<6;j=j+1)
{
cout<<vetorA[j]<<"\t\t"<<vetorB[j]<<"\t\t"<<vetorC[j]<<"\t\t"<<vetorD[j]<<"\n";
}
getch();
}

You might also like