Re: [algogeeks] Write a program to Convert an ASCII representation of a positive integer to it's numeric value ??

2011-09-10 Thread shady
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

Re: [algogeeks] Write a program to Convert an ASCII representation of a positive integer to it's numeric value ??

2011-09-10 Thread Ishan Aggarwal
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

Re: [algogeeks] Write a program to Convert an ASCII representation of a positive integer to it's numeric value ??

2011-09-10 Thread shady
#include stdio.h #includestring.h main(){ char *s = 88934\0; int sum=0; int i=0; while(istrlen(s)){ int value = s[i]-'0'; sum = 10*sum+value; i++; } printf(%s %d\n, s, sum); } On Sat, Sep 10, 2011 at

Re: [algogeeks] Write a program to Convert an ASCII representation of a positive integer to it's numeric value ??

2011-09-10 Thread sukran dhawan
u can use atoi function On Sat, Sep 10, 2011 at 10:26 PM, shady sinv...@gmail.com wrote: #include stdio.h #includestring.h main(){ char *s = 88934\0; int sum=0; int i=0; while(istrlen(s)){ int value = s[i]-'0'; sum =