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

Function main

CPP/searching/linear_search.cpp:18–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16#endif
17}
18int main(){
19 initial();
20 int arr[]={12,13,14,44,55,66,67,88};
21 int key;
22 cin>>key;
23 int n= sizeof(arr)/ sizeof(int);
24 int index= linear(arr,key,n);
25 if (index!=-1)
26 {
27 cout<<key<<" is present at"<<index<<endl;
28 }
29 else{
30 cout<<key<<" is not present"<<endl;
31 }
32
33 return 0;
34}

Callers

nothing calls this directly

Calls 2

linearFunction · 0.85
initialFunction · 0.70

Tested by

no test coverage detected