Write a function which accepts a sentence as input
parameter.Each word in that sentence is to be reversed.
Space should be there between each words.Return the sentence
with reversed words to main function and produce the
required output.
for eg:- i/p: jack jill jung kill
o/p: kcaj llij gnuj llik
Answer / vivek
#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 ? | 1 Yes | 1 No |
Can you declare an array of mixed Types?
"c sharp" code for factorial using static variables
program to check if a number is "perfect number".
write a Program to copy the string using switch case.
How to pass multiple rows from one gridview to another gridview after clicking the checkbox.
Hello Sir, Thanks for the Solution but, can you pls. Explain the coding for the Static Function & static variable from the below coding....waiting for Ans. class fact { public static void Main() { fact f=new fact(); int x=1; //Declaration of x as 1 int k=Convert.ToInt32(Console.ReadLine()); for(int i=1;i<=k;i++) { x= x *i; } System.Console.WriteLine(x); } }
Write a program to input an integer and - display the reverse - display the sum of each digit - should include logic that considers the input number as any number of digits long
working with arrays
Code for Searching for Multiple Matches with the MatchCollection Class?
Write a program to convert postfix expression to infix expression.
IS Array list is generic or non generic
Coding for using Nullable Types in C#?