Skip to main content

Reversing the String

Program for String Reverse
int main(void)
{
        char    S[] = "Vijay C Programming";
        int     i, j;
        for( i=0, j=strlen(S)-1; i<((strlen(S))/2); ++i, --j )
        {
             S[i]  ^= S[j] ^=  S[i]  ^= S[j];
        }
        printf( "Reverse Is : %s\n", S );
        return 0;
}

Comments

Popular posts from this blog

CAN INTERVIEW QUESTIONS

Qualifiers and Modifier in C

RTOS Real time operating system interview questions

CAN INTERVIEW QUESTIONS 2

What is UDS protocol

Memory mapping in c

TOP IOT PLATFORMS