#include <stdio.h>
#include<string.h>

main(){
        char *s = "88934\0";
        int sum=0;
        int i=0;
        while(i<strlen(s)){
                int value = s[i]-'0';
                sum = 10*sum+value;
                i++;
        }
        printf("%s %d\n", s, sum);
}


On Sat, Sep 10, 2011 at 10:20 PM, Ishan Aggarwal <
[email protected]> wrote:

> Not able to find some good solution for this...
>
>
> On Sat, Sep 10, 2011 at 10:17 PM, shady <[email protected]> wrote:
>
>> string manipulation... google it.
>>
>> On Sat, Sep 10, 2011 at 10:06 PM, Ishan Aggarwal <
>> [email protected]> wrote:
>>
>>>
>>>
>>> --
>>> Kind Regards
>>> Ishan Aggarwal
>>> [image: Aricent Group]
>>> Presidency Tower-A, M.G.Road,Sector-14
>>> Gurgaon,Haryana.122015 INDIA
>>> Phone : +91-9654602663
>>> [email protected] <[email protected]>
>>>
>>>  --
>>> 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.
>>>
>>
>>  --
>> 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.
>>
>
>
>
> --
> Kind Regards
> Ishan Aggarwal
> [image: Aricent Group]
> Presidency Tower-A, M.G.Road,Sector-14
> Gurgaon,Haryana.122015 INDIA
> Phone : +91-9654602663
> [email protected] <[email protected]>
>
>  --
> 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.
>

-- 
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