Search This Blog

Translate

c Program example reverse the string without using library function.

Write a function to reverse the string with out using library function.

MCA c programming exam 2013-2014 solve example with source code

Write a function to reverse the string with out using library function.

#include
void reverse(char *str)
{
            char temp;
            int i, j;
            for(i = 0, j = 0; str[i] !=’\0’; i++)
                        j++;
            i = 0;
while( i < j)
{
            temp = str[i];
            str[i] = str[j];
            str[j] = temp;
i++;
j--;
            }
}

C Program example List

Google+ Badge