i am doing a C++ program that gets number of vectors, so user can input magnitude of each vector. using 3 functions
1.main function, 2.function that get the number of vectors(looping-number of vector must be positive) and 3.last function get the magnitude of vectors (looping - must be positive) and those input values should returns to the main function for calculation. how do u do that??
int main ()
{
int number_vectors;
int vectors;
cout << "VECTOR SUM\n";
for (int count = 0; count <= number_vectors; count ++)
{
cout << "Enter number of vectors: ";
cin >> number_vectors;
number_vectors = get_vectors (vectors);
}
return 0;
}
int get_vectors (int vectors)
{
while (vectors <= 0);
{
cout << "Number must be greater than 0.\n";
}
return (vectors);
}