when i use for loop to get a string i have following problem why?
include<stdio.h>
void main()
{
int i;
char name[5];
for(i=0;i<5;i++)
scanf("%c",&name[i]);
for(i=0;i<5;i++)
printf("%c",name[i]);
}
output
world
here for world i get only worl.
that is for 5 char I get only four why ?