#include<iostream.h> #include<constream.h> void read(int a[10],int n) { cout<<"reading\n"; for(int i=0;i<n;i++) cin>>a[i]; } void display(int a[10],int n) { for(int i=0;i<n;i++) cout<<a[i]<<"\t"; } void linearsearch ( int a[10],int n ) { int k,flag=0; read(a,n); display(a,n); cout<<"\nenter an element to be search\n"; cin>>k; for(int i=0;i<n;i++) { if(a[i]==k) flag=1; break; } if(flag==1) cout << "\nsearching is successful,element is found at position " << i +1<<endl; else cout<<"searching not successful\n"; } void main() { int a[10], n; clrscr(); cout<<"enter n value..\n"; cin>>n; linearsearch(a,n); getch(); } |
ADB commands for Android
Android
What are C Tokens?
C/C++
Least Recently Used Paging Algorithm
Advanced programs
First In First Out Page Replacement Algorithm
Simple programs
Java Program to find the IP address of the Machine
Basic Programs
Palindrome checking using function overloading
Advanced programs













can you please give me the code for non preemptive priority scheduling??...
#include main() {int n,i,j,at[10],bt[10],p[10],temp,T,st[10],tat[10],wt[10],S,...
This аrticle is genuinely a good one iit helps new the web visitors, who are ...
I m getting 2 errors in 16 th lin new. Nd char ch = str.charAT (0); plz change i...
I'm more than happy to find this site. I wanted to thank you for ones time due...