C++ Program for Linear search

C++ Program for Linear search

/**************************************************************	
	Author: Arun Vishnu M V
	Web: www.arunmvishnu.com
	Description: C++ Program for Linear search.
***************************************************************/
#include;   	
#include;  
void main()
{
	int array[100],n,found=0,i,find;
	clrscr();
	cout<<"How many numbers--> ";
	cin>>n;
	cout<<"Enter "<>array[i];
	cout<<"Enter a number to find--> ";
	cin>>find;
	for(i=0;i < n;i++)
	{
		if(array[i]==find)
		{	
			found=1;
			cout<<"\n" << find << " found at position: " << (i+1);
		}
	}
	if(found==0)
		cout<<"\nSorry! " << find << " does not found.";
	getch();
}

//---------------------- END--------------------

You may also like...

5 Responses

  1. mahesh says:

    requested
    i want these program plz sed me

  2. abhi says:

    explain please…

  3. rishu says:

    pyare arun ji
    mujhe aap se ek baat kehni hai
    .
    .
    .
    .
    .

    ..

    .
    .
    .
    .

    ..
    .

    .
    .
    .
    .
    .
    .
    .

    ..
    .
    .
    .
    .
    .
    .
    .
    .
    .

    .
    .

    .
    .
    .
    .
    .
    .
    ..
    .
    .
    .
    .
    .
    .
    .
    .
    .

    .
    .
    .
    .

    .
    .
    .

    .
    .

    .
    .
    .

    .
    .
    ..

    .
    ..

    .
    .
    .
    .
    .
    .
    .

    .
    .
    .
    .
    .

    aapke program mein 8 error ate hai . yeh btao braces shuru ek bar krke 3 bar aap khatm kaise kr skte ho :)))))) 😛

  4. Arun Vishnu says:

    @Rishu :-).. The program is correct, but the formating plugin i uses in this site is removing few portions of the program in specific patter. I have updated the pattern

  5. shan says:

    i have a some problem in this prgram

Leave a Reply

Your email address will not be published. Required fields are marked *