Untitled
unknown
plain_text
a year ago
720 B
7
Indexable
// Online C++ compiler to run C++ program online
#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,42);
return 0;
}Editor is loading...
Leave a Comment