Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main(){
- int i, x;
- int matrix[5][5];
- for(i=0; i<5; i++){
- for(x=0; x<5; x++){
- printf("Informe um numero:");
- scanf("%d", &matrix[i][x]);
- }
- }
- for(i=0; i<5; i++){
- for(x=0; x<5; x++){
- if(i==x){
- printf("PRINCIPAL: %d\n", matrix[i][x]);
- }
- }
- }
- for(i=0; i<5; i++){
- for(x=0; x<5; x++){
- if((i+x)==4){
- printf("SECUNDARIA: %d\n", matrix[i][x]);
- }
- }
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement