code for reverse alternate words from astring
Answer Posted / rohit
#include<stdio.h>
#include<conio.h>
int main()
{
char string[30]="hoow are you?";
static char stoken[15][10];
int i,j,k;
j=0;k=0;
for(i=0;string[i]!='\0';i++,k++)
{
if(string[i]==' ')
{
j++;
k=0;
}
else
{
stoken[j][k]=string[i];
}
}
for(i=j;i>=0;i--)
printf("%s\n",stoken[i]);
getch();
return 1;
}
| Is This Answer Correct ? | 6 Yes | 23 No |
Post New Answer View All Answers
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
hi any body pls give me company name interview conduct "c" language only
please explain every phase in the "SDLC" in the dotnet.
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
What is a shell structure examples?
What is the use of define in c?
Explain what is #line used for?
Write a program to reverse a linked list in c.
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
Is there a way to compare two structure variables?
how to find binary of number?
What are valid signatures for the Main function?