I have to write a program that will check each value in the array for a negative number then the program must either print "The array has no negative values" or "The array has at least one negative value". We have to use the funcion anynegatives(int a[], int arraysize) This is my code so far.
Any help would be appreciated.
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <iomanip>
anyNegative(int a[], int arraysize);
int main()
{
cont int arraysize=5;
int a[arraysize];
int i;
cout<<"Enter "<<arraysize<<" integers: ";
for (i=0; i=arraysize; i++)
cin>>a[i];
{
if( i >=0)
cout<<"The array has no negative value";
else
cout<<"The array has at least one negative value";
}
return 0;
}