1) By the time you get to line 13, you've changed the value of sentence so that it's pointing to the last character you entered. This means that you set P to point to the last character you entered, so that when you try and print the contents of the array, you're actually starting with the last character you entered.
2) Your loop at line 15 is based on whether or not the value of an element of the array is 0 (i.e. the null character '\0'). However, nowhere do you ever initialise the contents of the array to be 0, so you have no reason to believe any character in the array will have that value.
3) You increment sentence before you ever try to read any value into the array. This meand that you will never set any value in the first byte of the allocated memory.
4) Is there any reason you're using C? Are you aware that C++ has vastly better, safer string handling features? And dynamic memory allocation features?
new/delete is c++
malloc/free is C
you cannot delete where you used malloc. you cannot free where you used new. They will NOT work. malloc casting is considered odd in C, its required in C++ if you used malloc in c++ which you really should not in most cases (only reason is a very low level thing to allow a realloc).
a pointer IS an array, for all practical conversations (technically different of course):
you can use [] syntax on it
it is a solid block of memory
you can do the same core set of things to both, pointers have a few more operations. Stack vs heap is a thing but its irrelevant apart from managing the size/use of your stack, which isnt shown in the code proper but is at the high level comprehension of the program conceptual level.
That means you can get code working with arrays and change to pointers after testing, if that helps debug stuff. you can pass the name of an array into a function that wants a pointer.
there is NO reason to use a pointer here. 100 bytes is microscopic, and memory managment is slower, code bloated, and error prone. You do need to understand pointers and how to do this if you write C, but even in C, use an array for small blocks of memory, and let the stack handle the memory management stuff for you. Its faster and cleaner.
Make sure you are using a C compiler or telling the C++ compiler that you have C code. A C++ compiler will let you write a hybrid of the 2 languages that may not be correct in pure C.