Why is this not working
//Character Manipulation
#include <stdio.h>
int main()
{
int x;
//for loops
int counter=0;
//for input
char character;
char sentence[20];
printf("Press 1 to use getchar \n Press 2 to use gets \n Press 3 to use sscan \n ");
scanf("%d",&x);
switch(x)
{
case 1:
printf("Enter something");
while((character=getchar())!= '\n')
{
sentence[counter++]=character;
}
puts(sentence);
break;
}
}