Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define N 1000
  4. char* product(char *str, int k) {
  5.  
  6. int i ,j;
  7. for (i = 0; (str[i])!= '\0';i++);
  8. for (j = 0; (str[i]=str[i])!='\0';i++,j++);
  9. while (k!=0){
  10. printf ("%s",str);
  11. k--;
  12. }
  13. printf ("\n");
  14. return str;
  15. }
  16. int main () {
  17.  
  18. int k;
  19. scanf ("%d",&k);
  20. char *s = malloc (sizeof (char)*k);
  21. scanf ("%s",s);
  22. product (s,k);
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement