# include <stdio.h>
# include <conio.h>
# include <time.h>
# include <stdlib.h>
# include <string.h>
# include <ctype.h>
	int start;
	int last;
# define SIZE 10
	int largest (int num[],int msize);
	int smallest(int num[],int asize);
int main()
{
	int num[10]={0};
	int i;
	int min;
	int max;
	int pick;
	int pickk;
	int smallest;
	int largest;
	int temp;
	srand(time(NULL));
	for (i=0;i<10;i++)
	{
		num[i]= 1 + rand()%100;
		printf("%d\n",num[i]);
	}

	pick=smallest(num,10);
	printf("%d",pick);
	pickk=largest(num,10);
	printf("%d",pickk);

	for (i=0;i<10;i++)
	{
	printf("%d\n",num[i]);
	}
	getch();
}



int smallest(int num[],int asize)
{
	int i;
	int min;
	min=num[0];
	for (i=1;i<asize;i++)
	{
		if (num[i]<min)
			min=num[i];
	}
	return min;
}

int largest(int num[],int msize)
{
	int i;
	int max;
max=num[0];
	for (i=1;i<msize;i++)
	{
		if (num[i]>max)
			max=num[i];
	}
	//printf("\nMax#: %d\n",max);
	return max;
}

im getting the error
Function array.cpp(31): error C2064: term does not evaluate to a function taking 2 arguments

Function array.cpp(33): error C2064: term does not evaluate to a function taking 2 arguments

Can someone please tell me where im going wrong thanks

Recommended Answers

All 3 Replies

You have redeclared "smallest" and "largest" as ints in main(). There's no need to do that.

commented: thanks man this really help +0

It would help if you posted your code in CODE tags.

As well has having functions called smallest and largest you also have variables (int) called smallest and largest.

commented: Thanks this helps +0

WOW thanks guys i really didnt see that

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.