Welcome, guest | Sign In | My Account | Store | Cart

Saregard

C, 25 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>
#include <string.h>

void suffix(char text[]);

int main() {
    char text[1000];
    
    printf("Text: ");
    scanf("%s", text);
    
    suffix(text);
    
    return 0;
}

void suffix(char text[]) {
    if (strlen(text)) {
        printf("%s\n", text);
        text[strlen(text) - 1] = '\0';
        suffix(text);
    } else {
        return;
    }
}
Created by Emilian on Wed, 15 May 2013 (MIT)
C recipes (32)
Emilian's recipes (2)

Required Modules

  • (none specified)

Other Information and Tasks