|
|
back to boardError-Reg #include<stdio.h> int main() { int M[20],ID[20],N,temp,temp1,i,j; scanf("%d",&N); if(N>150000||ID[20]>10^7||M[20]>100) printf("Invalid input\n"); else { printf("Enter the No.of.teams:\n",N); for(i=0;i<N;i++) { scanf("%d %d",&ID[i],&M[i]); } for(i=0;i<N;i++) { printf("ID:%d M:%d\n",ID[i],M[i]); } for(i=0;i<N;i++) for(j=0;j<N-1;j++) { if(M[j]<M[j+1]) { temp=M[j]; M[j]=M[j+1]; M[j+1]=temp; temp1=ID[j]; ID[j]=ID[j+1]; ID[j+1]=temp1; } } printf("Bubble sort desending order\n"); for(i=0;i<N;i++) { printf("ID: %d M:%d \n",ID[i],M[i]); } } }
Whats wrong with this code. Any one know means pls tell the error. |
|
|