Commit df4df387 by otsall

Upload New File

parent 97c7a403
Showing with 30 additions and 0 deletions
#include <stdio.h>
int main(){
int matrix[5][5],
i,
j,
k;
for(i = 0; i < 5; i++){
for(j = 0; j < 5; j++){
printf("please enter value at [%d][%d]\n", i, j);
scanf("%d", &matrix[i][j]);
}
}
for(i = 0; i < 5; i ++){
for(j = 0; j < 5; j++){
k = 2;
while(k < matrix[i][j]){
if(matrix[i][j] % k == 0){
break;
}else{
k++;
}
}
if(k >= matrix[i][j]){
printf("printing all prime numbers\n");
printf("%d\n", matrix[i][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