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 / gunapala

start=0;
for(i=0;str[i]!='\n';i++)
{
if(str[i]!=' ')
{
for(j=i;j>=start;j--)
{
b[k++]=str[j];
}
start=start+1;
}
printf("/s",b);
}
}
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.

2644


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

14955


What is an auto keyword in c?

639


Is there any demerits of using pointer?

624


Explain what are global variables and explain how do you declare them?

635






When a c file is executed there are many files that are automatically opened what are they files?

589


What is structure data type in c?

565


What is the most efficient way to count the number of bits which are set in an integer?

587


What are type modifiers in c?

619


What is the purpose of clrscr () printf () and getch ()?

591


List the difference between a "copy constructor" and a "assignment operator"?

578


How many header files are in c?

547


What is New modifiers?

665


How can you convert integers to binary or hexadecimal?

612


Why is main function so important?

611