Prog#074: Read a string until newline

/* 
Program#74
Read a string until newline
*/

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

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