<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rayhan's blog (raynux.com) &#187; C</title>
	<atom:link href="http://raynux.com/blog/category/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://raynux.com/blog</link>
	<description>Rayhan's Personal Web Blog Site</description>
	<lastBuildDate>Fri, 16 Oct 2009 06:07:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>A Simple C Program To Sum Two Large Number</title>
		<link>http://raynux.com/blog/2008/03/12/a-c-program-to-add-two-large-number/</link>
		<comments>http://raynux.com/blog/2008/03/12/a-c-program-to-add-two-large-number/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 12:49:24 +0000</pubDate>
		<dc:creator>rayhan</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://raynux.com/blog/?p=12</guid>
		<description><![CDATA[I have very little knowledge on C. With this little knowledge I am helping a student of EEE department of BUET. I am requested to help in writing a program to perform addition and multiplication of two large number. In C there is no builtin datatype for large number and as a PHP programmer we [...]]]></description>
			<content:encoded><![CDATA[<p>I have very little knowledge on C. With this little knowledge I am helping a student of EEE department of BUET.  I am requested to help in writing a program to perform addition and multiplication of two large number. In C there is no builtin datatype for large number  and as a PHP programmer we are not bound to data type like C. So this is a quite tricky for me. As I am require to work and munipulate with string type variable. I always hate the hassle of C in case of Char type variable. Finally I am end up with the following program to perform addition.</p>
<p>This is a simple c program to sum two big number using c programming language.</p>
<pre>
#include&lt;stdio.h&gt;
#include&lt;string.h&gt;
#include&lt;stdlib.h&gt;
#include&lt;ctype.h&gt;
int chrtoint(char a){
int i;
for (i = 48; i&lt;=57; i++)
if (toascii(i)==a) return i-48;
return 0;
}

void main(){
char n1[80];
char n2[80];
int rs[80];
int c1, c2;

int i,j,m, cmax, sum;

printf("Enter First Number:");
scanf("%s", &amp;n1);
printf("\nEnter Second Number:");
scanf("%s", &amp;n2);
c1 = strlen(n1);
c2 = strlen(n2);

strrev(n1);
strrev(n2);

cmax = c1;
if(c1&lt;c2){
cmax = c2;
}

m=0;
for(i=0; i&lt; cmax; i++){
if(c1==c2 || (i &lt; c1 &amp;&amp; i &lt; c2)){
sum = m+chrtoint(n1[i])+chrtoint(n2[i]);
}else if(i &gt;=c1){
sum = m+chrtoint(n2[i]);
}else if(i &gt;=c2){
sum = m+chrtoint(n1[i]);
}
rs[i] = sum%10;
m = sum/10;
}

if(m){
rs[i]=m;
i++;
}

printf("\nResult: ");
for(j=0; j &lt; i; j++){
printf("%d", rs[i-j-1]);
}

}
</pre>
<p>Hope I will solve the multiplication problem soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://raynux.com/blog/2008/03/12/a-c-program-to-add-two-large-number/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
