#include<stdio.h> int main() { int arr[10],n,i,element,found=0; printf("Enter The Number of Array Element:\n"); scanf("%d",&n); printf("Enter The %d Array Elements\n",n); for(i=0;i<n;i++) { scanf("%d",&arr[i]); } printf("\nElements in Array are:\n"); for(i=0;i<n;i++) { printf("%d\t",arr[i]); } printf("\nEnter Element To Search:\n"); scanf("%d",&element); for(i=0;i<n;i++) { if(arr[i]==element) { printf("\nElement %d found at Position %d\n",element,i+1); found=1; } } if(found==0) printf("\nElement %d Not Found in Array\n",element); return 0; }
Most Popular
-
Befunge: Developed by : Chris Pressey Year: 1993 Stack-based, reflective, esoteric programming language.
-
-
The list below is an unordered list. You can pick any book you like, and some of the books don’t even cover a programming language at all,...
-
Recursion happens when function calls itself directly or indirectly.
Copyrights © 2016 Codzya. Powered by Blogger.
Monday, May 2, 2016
Subscribe to:
Post Comments (Atom)
Recent
Weekly
-
Befunge: Developed by : Chris Pressey Year: 1993 Stack-based, reflective, esoteric programming language.
-
-
The list below is an unordered list. You can pick any book you like, and some of the books don’t even cover a programming language at all,...
-
Recursion happens when function calls itself directly or indirectly.
-
1- The C Programming Language This book is a comprehensive guide to the finalized ANSI standard C language programming. It has b...
Comment
Get this Recent Comments Widget
!->
0 Comment to "Linear Search"
Post a Comment