#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 ...
-
-
The list below is an unordered list. You can pick any...
-
Recursion happens when function calls itself directly...
Copyrights © 2016 Codzya. Powered by Blogger.
Monday, May 2, 2016
Subscribe to:
Post Comments (Atom)
- Recent
- Weekly
- Comment
Recent
As a task executes it utilizes the processor...
Sep 25 2016 | Read moreMemory leak occurs when programmers create a memory in heap and...
Aug 19 2016 | Read moreBefunge: Developed by : Chris Pressey Year: 1993 Stack-based,...
May 19 2016 | Read more1- The C Programming Language This book is a comprehensive...
May 18 2016 | Read more1. Java The tech community recently celebrated the 20th...
May 17 2016 | Read more
Weekly
-
Befunge: Developed by : Chris Pressey Year: 1993 ...
-
-
The list below is an unordered list. You can pick any...
-
Recursion happens when function calls itself directly...
-
1- The C Programming Language This book is a...
Comment
Get this Recent Comments Widget
0 Comment to "Linear Search"
Post a Comment