Monday, 27 October 2014

Write a c++ program that initializes an array. It inputs a value from the user and searches the number in the array.

Leave a Comment

Code-:

#include<iostream>
using namespace std;
void main()
{
int number[10];
int temp;
for (int i=0;i<10;i++)
{
cout<<"input numbers in array = ";
cin>>number[i];
}
cout<<"Enter Number for search = ";
cin>>temp;
for(int b=0;b<10;b++)
{
if(temp==number[b])
cout<<"You find the Value on "<<b<<" index "<<endl;
}
system("pause");

}

If You Enjoyed This, Take 5 Seconds To Share It