Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
Practice Tech Mahindra Essay Topics

Program Discussion :: Strings

Home > Programs > Strings

45 / 59

Write a program to reverse an array without affecting special characters.
Note: Given a string, that contains special character together with alphabets ('a' to 'z' and 'A' to 'Z'), reverse the string in a way that special characters are not affected.

Answer:

#include 
#include 
int isSpecial(char);
int main()
{
char hel[] = "a!!!b.c.d,e'f,ghi";
char *anj = hel;
reverseWord(hel);
printf("%s",anj);
return 0;
}

void reverseWord(char *anj)
{
    int r = strlen(anj)-1;
    char x;
    int l = 0;
    while (l='A' && x='a' && x

Asked In ::

Post Your Answer Here:

Language:

Post Your Reply Here: