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 "< } }
i want a c or c++ code for solving transportation problem using modified distribution method
Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec
Object Conversions Just like initialization, conversions are also done automatically when an object of a derived class is assigned to an object of the base class. Though, the c
Explain structured programming The principal idea behind structured programming was as easy as the idea of "divide and conquer." A computer program could be regarded as having
Explain the Macros? Preprocessor' is a translation stage that is applied to your source code before the compiler proper gets its hands on it. Usually the preprocessor performs
At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers
Q: In p = new Fred(), does the Fred memory "leak" if Fred constructor throws an exception? A: No. If an exception take place during the Fred constructor of p = new F
Calculate the area of a rectangle
within 2 mins give me answer pllzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
how to change meter to miles
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