Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <time.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. int main()
  6. {
  7. srand(time(0));
  8. int i,j;
  9. int n = 5;
  10. float tab[n][n];
  11. printf("\nPrzed zmiana: \n");
  12. for(i=0;i<n;i++)
  13. {
  14. for(j=0;j<n;j++)
  15. {
  16. tab[i][j] = rand()%11;
  17. printf("%5.2f",tab[i][j]);
  18. }
  19. printf("\n");
  20. }
  21.  
  22. printf("\n");printf("\n");
  23. printf("\nPo zmianie: \n");
  24.  
  25. for(i=0;i<=n;i++)
  26. {
  27. for(j=0;j<=i;j++)
  28. tab[i][j] = 0;
  29.  
  30. }
  31. for(i=0;i<n;i++)
  32. {
  33. for(j=0;j<n;j++)
  34. {
  35. printf("%5.2f",tab[i][j]);
  36. }
  37. printf("\n");
  38.  
  39. }
  40.  
  41.  
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement