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

C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

608


What is the modulus operator?

735


What is the difference between c &c++?

645


What is double pointer in c?

586


Describe newline escape sequence with a sample program?

654






Lists the benefits of c programming language?

594


How do you print an address?

744


When can you use a pointer with a function?

566


Why is c so important?

594


What is a program flowchart and explain how does it help in writing a program?

671


Differentiate between the expression “++a” and “a++”?

699


How important is structure in life?

590


List the difference between a 'copy constructor' and a 'assignment operator' in C?

637


The __________ attribute is used to announce variables based on definitions of columns in a table?

669


Was 2000 a leap year?

630