Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

pgm to reverse string using arrays i.e god is love becomes
love is god)
(assumption:only space is used for seperation of words)

no addtional memory used.i.e no temporary arrays can used.

Answer Posted / ruchi

#include<stdio.h>
#include<conio.h>
int main()
{
int i=0,c;
char a[20];
printf("\nEnter the string");
while((a[i++]=getchar())!='\n');
printf("\nReverse of the string is ");
for(c=i;c>=0;c++)
{
printf("%c"a[c]);
}
getch();
}

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is LINKED LIST? How can you access the last element in a linked list?

1117


What are the different types of endless loops?

1129


Explain what is the benefit of using an enum rather than a #define constant?

1277


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

1322


What is the use of header files?

1157


When can a far pointer be used?

1080


What are dangling pointers in c?

1356


What is the data segment that is followed by c?

1142


application attempts to perform an operation?

2036


What is c language and why we use it?

1123


What is a lookup table in c?

1176


Does c have circular shift operators?

1302


How do you redirect a standard stream?

1154


What is the basic structure of c?

1155


Explain the difference between the local variable and global variable in c?

1135