Run Code
|
API
|
Code Wall
|
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
polymorphism simulation in plain C with a simple structures
1.4 Thread IDs
hello
Lab 9 v0.9
888 BONUS LAB 1
co_assign1_ques_4
a1
Finding the second largets value v0.6
bitmask shift
Instruction order in C/C++