The cause of the problem:
scanf("%c",&l) //Here %c takes enter key of scanf("%s",s);
;
So, in your problem there are mainly 2 solutions:
Sol. 1 =>scanf(" %c",&l) //use whitespace before %c
Sol. 2 => Use fflush (stdin), which flushes the stream's output buffer.
int main()
{
char s[100],l;
printf("Enter A String:\n");
scanf("%s",s);
printf("Enter A Letter:\n");
fflush(stdin);
scanf("%c",&l);
l = getchar();
......
......
}
NOte: Since fflush (stdin) has undefined behavior, so always use priority for solution 1 instead of fflush (). :)