#include <iostream>
using namespace std;
int main()
{
int arr[5];
int n, i, m=0, flag=0;
cout << "Enter the Number: ";
cin >> n;
m=n/2;
for(i = 2; i <= m; i++)
{
if(n % i == 0)
{
flag=1;
break;
}
}
if (flag==0)
arr[3]=n;
cout<<"\nThe element in the 3rd index of the array is: "<<arr[3];
return 0;
}
Comments
Leave a comment