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 isn't any of this standardized in c? Any real program has to do some of these things.

1148


Can two or more operators such as and be combined in a single line of program code?

1310


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

1104


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

1145


What is a static variable in c?

1067


How can a program be made to print the name of a source file where an error occurs?

1175


a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none

1090


Explain the use of 'auto' keyword in c programming?

1071


What is an array? What the different types of arrays in c?

1104


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

991


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

2357


Is it fine to write void main () or main () in c?

965


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

2145


What is a function simple definition?

1032


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1024