Commit 9667aaf9 by viakul

Upload New File

parent 9ac14232
Showing with 37 additions and 0 deletions
#include <stdio.h>
int main()
{
int matrix[5][5];
int i, j ,k;
for (i=0;i<5;i++){
for(j=0;j<5;j++){
printf("insert the value for [%d %d]\n", i+1, j+1);
scanf("%d",&matrix[i][j]);
}
}
for (i=0;i<5;i++){
j = 0;
while(j<5){
k=2;
if(k >= matrix[i][j]){
printf("matrix[%d][%d] is %d\n", i+1, j+1, matrix[i][j]);
}
while(k<matrix[i][j]){
if(matrix[i][j] % k == 0){
break;
}
k++;
if(k == matrix[i][j]){
printf("matrix[%d][%d] is %d\n", i+1, j+1, matrix[i][j]);
}
}
j++;
}
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment