Guest User

Untitled

a guest
Jan 23rd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. void diagonalfile()
  2. {
  3. int x=0;
  4. int y=0;
  5. building[x][y]=number;
  6. int sum=0;
  7.  
  8. printf("\n\n\n\t FILE OPEN \n\n\n");
  9. inp=fopen( " 2Dimdata.txt ","r");
  10. if(inp==NULL)
  11. {
  12. printf(" file 2Dimdata.txt failed to open");
  13. exit(0);
  14. }
  15.  
  16. for(x=0; x<10;x++)
  17. {
  18. for(y=0; y<10;y++)
  19. {
  20. fscanf(inp,"%d",&number);
  21. printf("sum of diagonla equals %d",sum,building[x][y],(sum=sum+building[x][x]));
  22. }
  23. }
  24. }
Add Comment
Please, Sign In to add comment