split all the words using string tokenizer with delimiter as space then
print the array of words in reverse order.

On Wed, Jul 27, 2011 at 8:31 PM, somya mishra <somya.bvm...@gmail.com>wrote:

> m nt getting correct output for this program can any1 tell me wats the
> error
>
> #include<iostream.h>
> #include<conio.h>
> #include<string.h>
> void main()
> {
>  char a[]="Hello daughter";
>  cout<<a<<"\n";
>  int l,i,j,k,c;
>  int temp;
>  l=strlen(a);
>  for(i=0;i<l/2;i++)
>  {
>   temp=a[i];
>   a[i]=a[l-i-1];
>   a[l-i-1]=temp;
>  }
>  cout<<a<<"\n";
>  k=0;
>  c=0;
>  a[l]='\0';
>  for(i=0;i<=l;i++)
>  {
>   if(a[i]!=' ')
>   {
>    c++;
>    cout<<"c="<<c<<"\n";
>   }
>   else
>   {
>    for(j=i-1;j>=c/2;j--)
>    {
>     temp=a[j];
>     a[j]=a[k];
>     a[k]=temp;
>     k++;
>    }
>    c=0;
>    k=i+1;
>   }
>  }
>  cout<<a;
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
with regards,
Priyanka Loya

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to