int main() {
char c, s[100];
int i = 0;
scanf("%c", &c);
while (c != '\n')
{
s[i++] = c;
scanf("%c", &c);
}
for(int j=0; j<i; j++) cout<<s[j];
printf("%s", s);
return 0;
}
however, only cout<<s; or printf("%s", s); wont be working properly, you have to use loop again.
btw, hit Enter at the end of string otherwise it gives RTE: http://ideone.com/6aO2Gg