#include
#include
int main()
{
int in,i,j;
char *arr[100],str[14];
scanf(\"%d\",&in);
i=0;
while(i
Your problem is arr[i]=str; statement.
str is a statically allocated array, and all the arr[i] are storing the base address of it.
As the value of str get overwritten in every call to scanf(), in your case, only the last value stored in str will be printed by accessing any arr[i].
What you need to do
arr[100].str to arr[i]Note: Don't forget to free() the allocated memory at last.