Linear Search
Linear Search in C
C Programming "Linear Search"
Linear Search in C
C Programming "Linear Search"
#include<stdio.h> int main() { int arr[10],i,value,index; printf("Please enter 10 values:\n"); for(i=0;i<10;i++) scanf("%d",&arr[i]); printf("\nEnter a value to be searched: "); scanf("%d",&value); index = -1; for(i=0;i<10;i++) { if(arr[i]==value) { index=i; break; } } if(index>=0) printf("Value found in Array at %d location",index); else printf("Value not found in Array"); return 0; }
LiBinary Search
Binary Search in C
C Programming "Binary Search" - See more at: http://www.programming-and-it-research-center.blogspot.com/#sthash.b5niQNhp.dpuf
Binary Search in C
C Programming "Binary Search" - See more at: http://www.programming-and-it-research-center.blogspot.com/#sthash.b5niQNhp.dpuf
bBinary Search
Binary Search in C
C Programming "Binary Search" - See more at: http://www.programming-and-it-research-center.blogspot.com/#sthash.b5niQNhp.dpuf
Binary Search in C
C Programming "Binary Search" - See more at: http://www.programming-and-it-research-center.blogspot.com/#sthash.b5niQNhp.dpuf
No comments:
Post a Comment