MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / searching

Function searching

Arrays/32_Operations_on_arrays.c:212–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212int searching()
213{
214 int element, crash = -1;
215insertSearchingCheckpoint:
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
236int sorting()
237{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected