- #include <stdio.h>
- void main(void)
- {
- char string[128];
- int index = 0;
- int letter;
- printf("Type in a string and press Entern");
- while ((letter = getchar()) != 'n')
- string[index++] = letter;
- string[index] = NULL;
- printf("The string was: %sn", string);
- }