| 210 | } |
| 211 | |
| 212 | int searching() |
| 213 | { |
| 214 | int element, crash = -1; |
| 215 | insertSearchingCheckpoint: |
| 216 | printf("Enter the element you want to search for: \n"); |
| 217 | scanf("%d", &element); |
| 218 | for (int i = 0; i < a1.counter; i++) |
| 219 | { |
| 220 | if (a1.array1[i] == element) |
| 221 | { |
| 222 | crash = i; |
| 223 | } |
| 224 | } |
| 225 | if (crash >= 0) |
| 226 | { |
| 227 | printf("The index of %d is %d\n", element, crash); |
| 228 | } |
| 229 | else |
| 230 | { |
| 231 | printf("No element found\n"); |
| 232 | goto insertSearchingCheckpoint; |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | int sorting() |
| 237 | { |