EdocGram
Home
(current)
Topics
EdocAI
Code Editor
HTML
Javascript
PHP
Python
Python AI Code Editor
More
Contact
About
Privacy Policy
Terms and Conditions
Log In
Topic: Matrix Manipulation Problem / Level: beginner
Problem:
Write a program to calculate the sum of all prime elements in the middle diagonal of a square matrix.
More Problems
Write a program to print the matrix in a spiral pattern starting from the bottom-right corner.
Write a program to print the matrix in a reverse spiral pattern starting from the top-left corner.
Write a program to check if all elements in the first diagonal are multiples of 2.
Write a program to check if all elements in the second diagonal are multiples of 5.
Write a program to print all prime elements in the first diagonal of a square matrix.
Write a program to print all prime elements in the second diagonal of a square matrix.
Write a program to replace all even elements in the matrix with 0 and all odd elements with 1.
Write a program to replace all prime elements in the matrix with -1 and all composite elements with 1.
Python
Language
Editor
Run & Output
Save
AI Code Generate
AI Test Case
Run the code to see the output here...