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 symbol indicated the c-preprocessor?
What is a char in c?
What is file in c language?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
What is a stream?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
What is the difference between far and near ?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
What is wrong with this program statement?
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply
Explain pointers in c programming?
Explain how do you print only part of a string?
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
Is Exception handling possible in c language?