Friday, November 2, 2012

Tugas_V_B4 : How to reverse value of index Array

Dear!Teacher, for this time i had made new program how to revert statement in Array A to B by saw your clues and this's my link in youtube  http://youtu.be/DjidCIRmaZo .
Source code :


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
char state[40];
char store[40];
int i=0,j=0,label;
printf ("Please input your statement for reverse : ");
gets (state);
strcpy(store,state);
label= strlen(state);
for (i=label;i>=0;i--)
{
if (i != label)
{
store[j]=state[i];
j++;
}
}
printf ("The statement was reverse like this : %s\n",store);
system ("pause");
return 0;
}



Thanks for watching.
Name : Phirum Tan
Major : Tiknik Media Digital



No comments:

Post a Comment