char a[20];
int l,i,j,k;
int main()
{
    char str[100];
    gets(str);
    l=strlen(str);
    for(i=l-1;i>=0;){
    k=19;
    a[k]='\0';
    while(i>=0 && str[i]!=' '){
         a[--k]=str[i--];
    }
    printf("%s",a+k);
    while(i>=0 && str[i]==' ') i--;
    printf(" ");
    }
}

On Thu, Jul 7, 2011 at 10:37 PM, Piyush Kapoor <[email protected]> wrote:

> Pls Ignore my above post..
>
>
> On Thu, Jul 7, 2011 at 10:36 PM, Piyush Kapoor <[email protected]>wrote:
>
>> char a[20];
>> int l;
>> int main()
>> {
>>      char str[100];
>>      scanf("%s",str);
>>      l=strlen(str);
>>
>>
>> }
>> --
>>  *Regards,*
>> *Piyush Kapoor,*
>> *CSE-IT-BHU*
>>
>>
>
>
> --
> *Regards,*
> *Piyush Kapoor,*
> *CSE-IT-BHU*
>
>


-- 
*Regards,*
*Piyush Kapoor,*
*CSE-IT-BHU*

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

Reply via email to