Sunday, June 26, 2011

C Programming - Program Untuk Membalik Kata atau Kalimat


#include <stdio.h>

int main()
{
    void terbalik();
    printf("Masukkan sembarang kalimat: ");
    terbalik();
    return 0;
}

void terbalik()
{
    char ch;
    ch = getchar();
    if (ch != 10)
    {
        terbalik();
    }
    putchar(ch);
}

No comments:

Post a Comment

LinkWithin

Related Posts Plugin for WordPress, Blogger...