This is a homework problem
I tried it out... but I get errors and I have no idea what they mean... would someone help me a little please?
ok.. i think writing out the problem will help whoever helps to get a better idea --->
Write a complete program that does the following:
The main() should ask the user for a number and store it in an integer variable named input. The main() should pass by value the integer to the function "int fxn1 (int x, int array[])"
fxn1 should ask the user how many muiltiples to calculate and store the users response in an int varialbe named num. fxn1 should then store the first num multiplies of x in array.
NOTE: store the first multiple in position 0, the second multiple in postion 1, and so on. The main should then display the contents of array. the main() should then pass the array to the function "int fxn2 (int a[])"
which returns the number of even numbers in a to main(). Main should then print out this number.
#include<iostream.h>
int fxn1 (int x, int array[]);
int fxn2 (int a[]);
void main()
{
int x, array[];
cout<<"Enter a number: \n";
cin>>x;
cout<<fxn1 (x, array[])<<endl<<endl;
cout<<fxn2 (array[i])<<endl;
}
int fxn1 (int x, int array[])
{
int num, multiplier=1;
cout<<"How many multiples to display?\n";
cin>>num;
for (int i=0; i<num; i++)
{
array[i]=x*multiplier;
multiplier++;
}
return array[i];
}
int fxn2 (int a[])
{
int even=0;
i=0;
do
{
if (a[i]%2==0)
even++;
i++;
}
while (i<)
return even;
}
-- THE END!!!!!
ok... something is messed up