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
What is the data segment that is followed by c?
What are the different types of C instructions?
Is it better to use a macro or a function?
What is the use of typedef in structure in c?
What is the acronym for ansi?
Can a variable be both const and volatile?
What is typedef example?
What is structure and union in c?
What does c mean before a date?
What are the key features in c programming language?
What is clrscr in c?
Explain what are reserved words?
What does 2n 4c mean?
What is extern storage class in c?
Can you think of a logic behind the game minesweeper.