code for reverse alternate words from astring



code for reverse alternate words from astring..

Answer / 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

More C Interview Questions

Eight queens puzzle

0 Answers  


What is the real time usage volatile?

2 Answers   Polycom,


say the following declaration is correct nr not. int b=a,n=0;

4 Answers   Wipro,


#include<stdio.h> int main() { int i=2; int j=++i + ++i + i++; printf("%d\n",i); printf("%d\n",j); }

15 Answers   Infosys,


how many keywords are available in 'c' language a) 32 b) 34 c) 45 d) 48

1 Answers  


difference between memcpy and strcpy

1 Answers  


Why do we use return in c?

0 Answers  


#define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? }

14 Answers   CDAC, GATE, NDS, TCS,


What is dangling pointer in c?

0 Answers  


What are the different categories of functions in c?

0 Answers  


what is uses of .net

0 Answers  


How to write in a function declaration and in function call in which the function has 'n' number of varible or arguments?

2 Answers  


Categories