#include <stdio.h>
#include <conio.h>
#include <string.h>
char kata[30];
void Tampil(int);
int main()
{
int n;
printf("Program pembalikan kata\n");
printf("Masukkan kata : ");
gets(kata);
n = strlen(kata)-1;
printf("Kata setelah dibalik : ");
Tampil(n);
printf("\n\n====================================================\n");
printf("\t\tVera Suryaningsih\n\tCopyright spirit221.blogspot.com\n");
printf("\n====================================================\n");
getch ();
return 0;
}
void Tampil(int n)
{
static int i=0;
if (n<0) return;//proses penghentian agar tidak memanggil dirinya sendiri
printf("%c",kata[n]);
Tampil(n-1); //memanggil tampil derajatnya turun 1
}
#include <conio.h>
#include <string.h>
char kata[30];
void Tampil(int);
int main()
{
int n;
printf("Program pembalikan kata\n");
printf("Masukkan kata : ");
gets(kata);
n = strlen(kata)-1;
printf("Kata setelah dibalik : ");
Tampil(n);
printf("\n\n====================================================\n");
printf("\t\tVera Suryaningsih\n\tCopyright spirit221.blogspot.com\n");
printf("\n====================================================\n");
getch ();
return 0;
}
void Tampil(int n)
{
static int i=0;
if (n<0) return;//proses penghentian agar tidak memanggil dirinya sendiri
printf("%c",kata[n]);
Tampil(n-1); //memanggil tampil derajatnya turun 1
}
Output
0 comments:
Post a Comment