Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main(){
- int arr[10]={1,6,3,7,8,2,4,0,9};
- cout<<"Enter Number you want to search :";
- int n ; cin >>n;
- for(int i = 0 ; i < 10 ; i++){
- if(n==arr[i]){
- cout<<n<<" found at index "<<i<<endl;
- break;
- }
- }
- }
Add Comment
Please, Sign In to add comment