Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Linear search in array - C program:
Write a program in c to define a linear search in array.
void main()
{
clrscr();
int a[100] , ch , n;
cout<<"enter the nit for the array : ";
cin>>n;
for (int i=0;i { cout<<"enter element "< cin>>a[i]; } Cout<< "Linear search:" lsearch (a,n); getch(); } //main void lsearch (int a[100] , int n) { int i,ele,found=0,pos=-1; cout<<"enter the element to be searched : "; cin>>ele; for (i=0;i { if (a[i] == ele) { found = 1 ; pos = i; } } if (found ==-1) { cout<<"element not found"; } else { cout<<"element found at "< } }
cout<<"enter element "<
cin>>a[i];
}
Cout<< "Linear search:"
lsearch (a,n);
getch();
} //main
void lsearch (int a[100] , int n)
int i,ele,found=0,pos=-1;
cout<<"enter the element to be searched : ";
cin>>ele;
for (i=0;i { if (a[i] == ele) { found = 1 ; pos = i; } } if (found ==-1) { cout<<"element not found"; } else { cout<<"element found at "< } }
if (a[i] == ele)
found = 1 ;
pos = i;
if (found ==-1)
cout<<"element not found";
else
cout<<"element found at "< } }
what is local and global variable?give me some example to understand better
Project Overview A certain financial institution (bank) wishes to promote its new business products/services by conducting road shows in rural areas. Their aim is to encourage peop
A: No. If they're utilized properly, they increase encapsulation. You frequently require splitting a class in half while the two halves will have distinct numbers of instances o
What does it mean to declare a 1. member function as a virtual A: (a) C++ virtual function is member function of any class, whose functionality may be over- ridden in
What is the role of && operator in a program code? - && is also referred to as AND operator. - When this operator is used, all conditions specified should be TRUE before nex
Produce data from fixed OCR areas scanned. Project Description: Project is to design software which can use character recognition only on certain areas of scanned puff's/ jpe
convert BST into sorted doubly linked list
A: No. While realloc() need to copy the allocation, this uses a bitwise copy operation, that will tear several C++ objects to shreds. C++ objects must be allowed to copy t
Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send
please answer the question of following Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? B
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd