We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ba909da + d38a429 commit 2d5eb2dCopy full SHA for 2d5eb2d
LINEARSE.CPP
@@ -0,0 +1,30 @@
1
+#include<conio.h>
2
+#include<iostream.h>
3
+void main()
4
+{
5
+ clrscr();
6
+ int a[11],n,i,k,flag=0;
7
+ cout<<"\nEnter the no.of elements:";
8
+ cin>>n;
9
+ cout<<"\nEnter the elements:";
10
+ for(i=0;i<n;i++)
11
+ {
12
+ cin>>a[i];
13
+ }
14
+ cout<<"\nEnter the element to be searched:";
15
+ cin>>k;
16
17
18
+ if(a[i]==k)
19
20
+ cout<<"\nElement found at position:"<<i+1;
21
+ flag=1;
22
+ break;
23
24
25
+ if(flag==0)
26
27
+ cout<<"\n Element not found...";
28
29
+ getch();
30
+}
0 commit comments