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 |
which do you prefer C or Pascal?
How is pointer initialized in c?
get any number as input except 1 and the output will be 1.without using operators,expressions,array,structure.don't print 1 in printf statement
write a program to interchange the value between two variable without using loop
what is different between auto and local static? why should we use local static?
Explain how do you generate random numbers in c?
Why use int main instead of void main?
how many times does the loop iterated ? for (i=0;i=10;i+=2) printf("Hi\n");
What does the function toupper() do?
#include<stdio.h> #include<conio.h> # define swap(a,b) temp=a; a=b; b=temp; void main( ) { int i, j, temp; i=5; j=10; temp=0; if( i > j) swap( i, j ); printf( "%d %d %d", i, j, temp); }
how to convert an char array to decimal array
What are the advantages and disadvantages of a heap?