Error: Misplace Else
I tried to print the largest number in the array but there's an error
showing misplaced else. I tried putting brackets around but there's still
an error in it. I don't have an idea why there is a misplaced else error.
Please help : >.<
#include <stdio.h>
#include <conio.h>
void main()
{
int lar, yem;
clrscr();
int aray[10];
for (yem = 0; yem < 10; ++yem)
{
printf("Input numbers:");
scanf("%d", &aray[yem]);
}
lar = aray[0];
for (yem = 1; yem < 10; ++yem)
{
if (aray[yem] > lar);
lar = aray[yem];
else
++yem;
printf("Biggest: %d\n", lar);
}
getch();
}
No comments:
Post a Comment