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