#include #include int main () { char *list_ptr; int list_length; int i = 0; printf ("Enter the length of the string: "); scanf ("%d", &list_length); list_ptr = malloc (list_length+1); getchar (); if (list_length > 0) { printf ("Enter the string (max length) %d: ", list_length); do { list_ptr[i] = getchar(); i++; } while (i < list_length); i = 0; while (i < list_length) { printf ("%c", list_ptr[i]); i++; } printf ("\n"); } }