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 "< } }
ABC Car Dealership needs your help to update the ordering system. This car dealer is selling four types of vehicles: Sedan, Truck, SUV, and mini Van. And each type of vehicle can h
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
The Preprocessor Directives A preprocessor directive which starts with a hash '#' ,is an instruction to the preprocessor, which acts on the source code before the compilation p
Write the statements which are used to connect PHP with MySQL? Statements which can be used to connect PHP with MySQL is: $conn = mysql_connect('localhost'); echo $co
how to search, display all data and delete data
Explain Rules for constructing variable names? The Rules for constructing variable names : a) A variable name is any combination of alphabets, 0 to 9 digits and undersc
Program to draw a circle: int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int midx, midy; int radius = 100;
Newton's method for cube roots is based on the fact that if y is an approximation to the cube root of x, then a better approximation is given by the value: (x/y 2 +2y)/3 (a)
program and solution for the above question
c programing forcalculating savings of an employee
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: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd