Examveda

There is a one line error in the following routine. Find that line.
1.	int Max(int a[], int n)
2.	{
3.		  int mi, i;
4.		  for (mi = 0, i = 0; i < n; i++)
5.		  if (a[i] > a[mi])
6.		  mi = i;
7.		  return mi;
8.	}

A. Line 2

B. Line 4

C. Line 6

D. Line 5

Answer: Option B


This Question Belongs to Data Structure >> Sorting Algorithms

Join The Discussion

Related Questions on Sorting Algorithms