Reverse a string word by word??

Answer Posted / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
char a[40],temp;
int count=0;
printf("enter the string :");
gets(a);
for(int i=0;a[i]!='\0';i++)
count++;
for(i=0;a[i]!='\0';i++)
{
if(count>i)
{
temp=a[i];
a[i]=a[count-1];
a[count-1]=temp;
count--;
}
else
break;
}
printf("the reversed ones is : ");
puts(a);
getch();
}

thank u

Is This Answer Correct ?    9 Yes 21 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to print fibonacci series using recursion?

832


Explain c preprocessor?

875


What are the application of void data type in c?

975


What do you mean by dynamic memory allocation in c?

853


What are preprocessor directives in c?

843


Compare array data type to pointer data type

820


Explain what is the most efficient way to store flag values?

937


int i=10; printf("%d %d %d", i, i=20, i);

1304


In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.

1614


What is an identifier?

814


What is void pointers in c?

781


What is merge sort in c?

838


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

930


Is c a great language, or what?

856


What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

861