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...

Write a function that accepts a sentence as a parameter, and
returns the same with each of its words reversed. The
returned sentence should have 1 blank space between each
pair of words.
Demonstrate the usage of this function from a main program.
Example:
Parameter: “jack and jill went up a hill” Return Value:
“kcaj dna llij tnew pu a llih”

Answer Posted / jeke kumar gochhayat

#include<stdio.h>
#include<string.h>
char *strrev1(char *st);
void main()
{
char st1[30];
char *pt1;
printf("enter the sentence");
gets(st1);
pt1=strrev1(st1);
puts(pt1);
}
char *strrev1(char *st)
{
int i;
char *pt=st;
for(i=0;st[i]!='\0';i++);
st[i]=' ';
st[i+1]='\0';
i=0;
for(;st[i]!='\0';i++)
{
for(;st[i]!=' ';i++);
st[i]='\0';
strrev(pt);
pt=st+i+1;
st[i]=' ';
}
return(st);
}

Is This Answer Correct ?    37 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the properties of union. What is the size of a union variable

1173


what does static variable mean?

1088


Explain null pointer.

1091


What is the use of getchar functions?

1168


Why is c platform dependent?

1067


Can the sizeof operator be used to tell the size of an array passed to a function?

1096


What are global variables and how do you declare them?

1069


What functions are used for dynamic memory allocation in c language?

1133


number of times a digit is present in a number

2022


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1680


What is difference between structure and union in c?

975


What is the explanation for cyclic nature of data types in c?

1189


What is nested structure?

1026


Tell us the use of fflush() function in c language?

1131


What is the difference between fread buffer() and fwrite buffer()?

1159