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 are the properties of union in c?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
write a program to display all prime numbers
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
Explain the use of fflush() function?
Difference between strcpy() and memcpy() function?
Explain what happens if you free a pointer twice?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Once I have used freopen, how can I get the original stdout (or stdin) back?
What are the disadvantages of c language?
Write a program to generate random numbers in c?
Where is c used?
Is null a keyword in c?
What is c standard library?