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
Create a simple code fragment that will swap the values of two variables num1 and num2.
What is #pragma statements?
How to declare a variable?
What is hashing in c language?
Explain the bubble sort algorithm.
Why does not c have an exponentiation operator?
What’s a signal? Explain what do I use signals for?
What is output redirection?
Write a program with dynamically allocation of variable.
Can we increase size of array in c?
When c language was developed?
Why C language is a procedural language?
Can we declare function inside main?
When should I declare a function?
What are structures and unions? State differencves between them.