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
Why do we need arrays in c?
What are the advantages of using linked list for tree construction?
What is || operator and how does it function in a program?
What is New modifiers?
Difference between constant pointer and pointer to a constant.
How will you find a duplicate number in a array without negating the nos ?
Write a program to print ASCII code for a given digit.
Why & is used in scanf in c?
can any one tel me wt is the question pattern for NIC exam
What is wild pointer in c with example?
What is %lu in c?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
Why doesnt this code work?
What is #include stdio h and #include conio h?
What is the heap?