Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sorted array
//gcc 5.4.0 #include <stdio.h> int main(void) { int arr1[5]={10,20,30,40,50},arr2[5]={10,60,70,60,50},arr3[10],i,k=0,j; printf("\nElement in the arrey is\n "); for(i=0;i<10;i++) { if(i>4) { arr3[i]=arr2[k]; k++; } else { arr3[i]=arr1[i]; } printf("\t\t\t%d\n",arr3[i]); } for(i=0;i<9;i++) { for(j=i+1;j<10;j++) { int temp=0; if(arr3[j]<arr3[i]) { temp=arr3[i]; arr3[i]=arr3[j]; arr3[j]=temp; } } } printf("the sorted element is"); for(i=0;i<10;i++) { printf("\t\n %d",arr3[i]); } return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
loop
150109_RecursividadFactorial
Area of the Cone
If Statement/ Decrements V2
Link List
array and its sum
fgets and basic string manipulation
B_141128_MatrizProducto
Memory leak
Sunday assignment late v3
Please log in to post a comment.