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 "< } }
##question.A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string co program in jav
A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome
compute algorithm to calculate simple interest
Although we can handle most I/O routines with getc and putc , there are file versions of fgets, fputs, fprintf and fscanf . The syntax is fgets(stringname,n,filename); Th
Problem : (a) What do you understand by the term ‘constructor' in Java? Explain with an appropriate example. (b) Describe the differences between an object and a class usi
Precautions with function overloading Function overloading is a boon to designers, since dissimilar names for same functions need not be thought of, which often is a cumbersome
i want this topic related programm
Create a pseudocode in getting Calendar Quarter. The program should identify which quarter falls the given date. Note: Consider the date format DDMMYYYY.
(i) Vilsmeir reaction
C Program to Check EVEN & ODD NO main() { int n, a; clrscr(); printf("ENTER ANY NUMBER: "); scanf("%d", &n);
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