input array elements:5,6,3,1,7

output:biggest number:7, second biggest=7

can anyone help me out what is wrong???

Code:/*c program to find out the maximum and the second maximum number from an array of integers*/ #include<stdio.h> #include<conio.h> void main() { int arr[10]; int i; int n; int big; int sec_big; printf("\n How many:"); scanf("%d",&n); for(i=0;i<n;i++) { printf("\n Enter %d number:",i+1); scanf("%d",arr[i]); } big=arr[0]; for(i=0;i<n;i++) { if(arr[i]>big) { big=arr[i]; } } sec_big=arr[0]; for(i=0;i<n;i++) { if((arr[i]>sec_big)&&(sec_big<big)) { sec_big=arr[i]; } } printf("\n Biggest number=%d,second biggest=%d",big,sec_big); getch(); }