write function to reverse char array ... without using second
array

Answer Posted / nagesh r. dalave

void main()
{
char strp20];
int len=0,i=0;
printf("\nEnter a string ");
gets(str);
while(str[i]!='\0')
{
i++;
len++;
}
printf("\nReverse of given string:");
while(i>=0)
{
printf("\n %c",str[i]);
i--;
}
getch();
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why & is used in scanf in c?

614


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

678


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2259


What is switch in c?

639


Are pointers integers in c?

604






What is pointer to pointer in c with example?

542


Can we increase size of array in c?

534


Explain what is a static function?

626


Explain how do you print an address?

652


What is selection sort in c?

601


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

723


What is the meaning of && in c?

543


What are the types of assignment statements?

622


What is a static variable in c?

661


What are compound statements?

622