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

Explain how do you search data in a data file using random access method?

1085


Describe dynamic data structure in c programming language?

1059


What should malloc(0) do?

1071


Explain do array subscripts always start with zero?

1196


What is a sequential access file?

1125


Explain how can I remove the trailing spaces from a string?

1011


Combinations of fibanocci prime series

1565


Explain is it better to bitshift a value than to multiply by 2?

1159


can we change the default calling convention in c if yes than how.........?

2493


What does 1f stand for?

1107


pierrot's divisor program using c or c++ code

2191


what will be the output for the following main() { printf("hi" "hello"); }

10870


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

1257


What are static variables in c?

1042


What is data structure in c programming?

1046