Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- main()
- {
- char c, s[11];
- int lim = 11;
- int i;
- while (1) {
- i = 0;
- c = '\0';
- while (i<lim-1) {
- if ((c=getchar()) != '\n') {
- if (c != EOF) {
- s[i] = c;
- ++i;
- }
- else {
- s[i] = '\0';
- break;
- }
- }
- else{
- s[i] = '\0';
- break;
- }
- if (i >= lim-1) {
- s[lim-1] = '\0';
- break;
- }
- }
- printf(s);
- printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement