You are on page 1of 1

/******************************************************************************

Online C++ Compiler.


Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

bool e_prim(int x)
{
int y=0, z=0;
for(y=1; y<=x; y++)

{
if(x%y==0)
z++;

}
if(z==2)
return 1;
else
return 0;
}

int main()
{
int mat[10][10], n=5, m=5, i=0, j=0, a=0, b=1, c=0,x=1;
for(i=0; i<m; i++)
for(j=0; j<n; j++)
{
if(e_prim(x)==1)
a[i][j]=x;
x++;
}

return 0;
}

You might also like