Untitled

mail@pastecode.io avatar
unknown
plain_text
9 days ago
671 B
2
Indexable
Never
#include <iostream>
using namespace std;
void kerkim_sekuencial(int arr[],int madhesia, int target)
{
    bool u_gjet=false;
    for(int i=0;i<madhesia; i++)
    {
        if(arr[i]==target)
           {
               u_gjet=true;
               cout<<"Elementi "<<target<<" u gjet ne pozicionin "<<i<<endl;
               break;
           }
          
    }
    if(u_gjet==false)
      cout<<"Elementi nuk u gjet ne vektor !"<<endl;
}

int main() {
    int numrat[11]={1,5,7,11,15,21,23,29,35,42,48};
    cout<<"Numrat e renditur jane :"<<endl;
    for(int i=0; i<11; i++)
    {
        cout<<numrat[i]<<" ";
    }
     kerkim_sekuencial(numrat,11,15);
    return 0;
}
Leave a Comment