Answer Posted / rohit_kamlakar
#include<iostream.h>
#include<string.h>
#include<stdio.h>
#include<conio.h>
void main()
{
int length,i,j;
char string[500];clrscr();
printf("Enter the string=");
gets(string);
length=strlen(string); int y=length,z=0;
for(i=length-1;i>=0;i--)
{
if(int(string[i])==32)
{ printf(" ");
for(j=i+1;j<length;j++)
{
printf("%c",string[j]);
z++;
}
length=y-z;
}
if(i==0)
{ j=i; printf(" ");
while(int(string[j])!=32)
{
printf("%c",string[j]);
j++;
}
}
}
getch();
}
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
How do you search data in a data file using random access method?
What is the difference between variable declaration and variable definition in c?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
What is a char in c?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
Explain how can type-insensitive macros be created?
What is the difference between call by value and call by reference in c?
What does dm mean sexually?
What is the purpose of the preprocessor directive error?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
What do you mean by a local block?
What is the difference between exit() and _exit() function in c?
When was c language developed?
Explain what is the general form of a c program?
how many key words availabel in c a) 28 b) 31 c) 32