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 in c to reverse string by word using array(god is love
becomes love is god)
(no additional array can used,space is only delimiter
between words )

Answer Posted / charan

#include <stdio.h>
#include <conio.h>
void main()
{
char *str;
char s[10][10];
int i=0,j=0,p=0;
clrscr();
printf("Enter the string");
gets(str);
while(str)
{
if(str[i]!=' ')
s[j][p++]=str[i];
else
{
s[j][p++]='\0';
p=0;
}
i++;
}
for(i=j;i>=0;i--)
puts(s[i]);
getch();
}

Is This Answer Correct ?    1 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why c is a mother language?

1040


What is the difference between declaring a variable and defining a variable?

1281


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

2096


What are the differences between Structures and Arrays?

1216


Why is this loop always executing once?

1058


Is exit(status) truly equivalent to returning the same status from main?

1077


What is null pointer in c?

994


What is exit() function?

1023


Difference between MAC vs. IP Addressing

1149


Array is an lvalue or not?

1130


How pointers are declared?

960


What is a program?

1268


What is the use of a ‘’ character?

1094


What is the size of array float a(10)?

1144


Can the “if” function be used in comparing strings?

1055