Prog#073: Read a string until dot

/* 
Program#73
Read a string until dot
*/

#include <stdio.h>
main(){
char a[100];
int i;

i=0;
scanf("%c",&a[i]);
while(a[i]!='.'){
i++;
scanf("%c",&a[i]);
}
a[i]='\0';
printf("\n%s",a);
}