Write code . Help me out?
Extracted text: Write a function named repeat that accepts a string (as a char+) and a number of repetitions as parameters and returns a heap-allocated string representing the parameter string concatenated that many times. For example, the call repeat ("hello", 3) returns a new string "hellohellohello". If the number of repetitions is 0 or less, an empty string ("") should be returned. (You do not need to free any memory.) 1 char* repeat (char*s1, int repetitions ){ if (repetitions <= ø)="" {="" 2="" 3="" return="" 4="" }else{="" char*="" a="(char*)" calloc(repetitions,="" sizeof="" (s1));="" for="" (="" int="" i="1;" i="">=><= repetitions="" ;="" i++){="" strcat="" (a,="" s1);="" 7="" 8="" return="" a;="" 10="" 11="" 12="" }="" 14="" n="" 3="">=>
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here