Guest User

Untitled

a guest
Feb 21st, 2019
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <stdlib.h>
  4. char *func(int N, char *k)
  5. {
  6. do
  7. {
  8. *k = N % 10 + '0';
  9. N = N / 10;
  10. } while (N != 0);
  11. return k;
  12. }
  13. int main()
  14. {
  15. int q[5][5];
  16. char c[5][5], k[25];
  17. for (int i = 0; i < 5; ++i)
  18. {
  19. for (int j = 0; j < 5; ++j)
  20. {
  21. q[i][j] = rand() % 25;
  22. printf("%d\t", q[i][j]);
  23. }
  24. printf("\n");
  25. }
  26. printf("\n");
  27. for (int i = 0; i < 5; ++i)
  28. {
  29. for (int j = 0; j < 5; ++j)
  30. {
  31. c[i][j] = *func(q[i][j], k);
  32. printf("%c\t", c[i][j]);
  33. }
  34. printf("\n");
  35. }
  36. _getch();
  37. }
Advertisement
Add Comment
Please, Sign In to add comment