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
Which header file should you include if you are to develop a function which can accept variable number of arguments?
Write a program to implement queue.
What is use of #include in c?
what does static variable mean?
Explain built-in function?
What is the difference between class and object in c?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
Why doesnt long int work?
Why we use break in c?
Why is c called a structured programming language?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What is function prototype in c with example?
Is python a c language?
What language is windows 1.0 written?
Why is c fast?