Search found 1 match

by fayed22
Sat May 23, 2015 7:46 pm
Forum: Volume 103 (10300-10399)
Topic: 10327 - Flip Sort
Replies: 81
Views: 22890

Re: 10327 - Flip Sort

why my code is getting is runtime error...plz help.. #include<stdio.h> int main() { int i,p[100],n,b,j,count; while((scanf("%d",&n))==1&&n!='\0') { count=0; for(i=0;i<n;i++) { scanf("%d",&p[i]); } for(i=0;i<n-1;i++) { for(j=0;j<n-i-1;j++) if(p[j]>p[j+1]) { b=p[j]; p[j]=p[j+1]; p[j+1]=b; count++; } }...

Go to advanced search