[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Program Discussion :: Strings

Home > Programs > Strings

340 / 60

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: