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 |
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
Write a program to convert postfix expression to infix expression.
Give the code for Handling Mouse Events?
"c sharp" code for factorial using static variables
Code for Reading and writing from a file in c#?
working with arrays
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
write a Program to copy the string using switch case.
Write a program which has a function and that function should take 2 or 3 or any number of strings and it should return the largest common prefix of all those strings. If there is no common prefix it should return an empty string. for eg:- INPUT OUTPUT glo {glory,glorious,glod} gl {glad,glow} {calendar,phone} empty string
Automatically Hyperlink URLs and E-Mail Addresses in ASP.NET Pages with C#
Write a program to count the number of characters, number of words, number of line in file.
Write a program to count 3Letter, 4Letter and 5Letter words from a file and print the number of 3Letter, 4Letter and 5Letter words. Delimiter is space, tab, hifen. Also we should not consider the line in the file after we encounter # in that line.