<?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>Complementary DNA Archives - Onestring Lab</title>
	<atom:link href="https://onestringlab.com/tag/complementary-dna/feed/" rel="self" type="application/rss+xml" />
	<link>https://onestringlab.com/tag/complementary-dna/</link>
	<description>Kode Kreativitas Kopi</description>
	<lastBuildDate>Mon, 04 May 2026 08:38:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://onestringlab.com/wp-content/uploads/2021/10/cropped-osl-high-res-e1455499003866-32x32.jpg</url>
	<title>Complementary DNA Archives - Onestring Lab</title>
	<link>https://onestringlab.com/tag/complementary-dna/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Belajar Bahasa C &#8211; Complementary DNA</title>
		<link>https://onestringlab.com/complementary-dna/</link>
		
		<dc:creator><![CDATA[Rajo Intan]]></dc:creator>
		<pubDate>Sat, 03 Dec 2022 02:00:00 +0000</pubDate>
				<category><![CDATA[Codewars]]></category>
		<category><![CDATA[C Language]]></category>
		<category><![CDATA[Complementary DNA]]></category>
		<guid isPermaLink="false">https://onestringlab.com/?p=788</guid>

					<description><![CDATA[<p>Deoxyribonucleic acid (DNA) is a chemical found in the nucleus of cells and carries the &#8220;instructions&#8221; for the development and functioning of living organisms. If &#8230; </p>
<p>The post <a href="https://onestringlab.com/complementary-dna/">Belajar Bahasa C &#8211; Complementary DNA</a> appeared first on <a href="https://onestringlab.com">Onestring Lab</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Deoxyribonucleic acid (DNA) is a chemical found in the nucleus of cells and carries the &#8220;instructions&#8221; for the development and functioning of living organisms.</p>



<p>If you want to know more: http://en.wikipedia.org/wiki/DNA</p>



<p>In DNA strings, symbols &#8220;A&#8221; and &#8220;T&#8221; are complements of each other, as &#8220;C&#8221; and &#8220;G&#8221;. Your function receives one side of the DNA (string, except for Haskell); you need to return the other complementary side. DNA strand is never empty or there is no DNA at all (again, except for Haskell).</p>



<p>More similar exercise are found here: http://rosalind.info/problems/list-view/ (source)</p>



<p>Example: (input &#8211;&gt; output)</p>



<pre class="wp-block-code"><code class="">"ATTGC" --&gt; "TAACG"
"GTAT" --&gt; "CATA"</code></pre>



<p>The problem link is <a href="https://bit.ly/3VBMbrN" target="_blank" rel="noreferrer noopener">here</a>.</p>



<p><strong>Solution:</strong></p>



<pre title="Complementary DNA" class="wp-block-code"><code lang="csharp" class="language-csharp line-numbers">#include &lt;string.h&gt;

char *dna_strand(const char *dna)
{

  int len = strlen(dna);
  int i;
  char *cdna = calloc(len + 1, sizeof(char));
  char temp;

  strcpy(cdna, "");

  for (i = 0; i &lt; len; i++)
  {
    if (dna[i] == 'A')
    {
      temp = 'T';
      strncat(cdna, &amp;temp, 1);
    }
    else if (dna[i] == 'T')
    {
      temp = 'A';
      strncat(cdna, &amp;temp, 1);
    }
    else if (dna[i] == 'C')
    {
      temp = 'G';
      strncat(cdna, &amp;temp, 1);
    }
    else if (dna[i] == 'G')
    {
      temp = 'C';
      strncat(cdna, &amp;temp, 1);
    }
  }
  return cdna;
}</code></pre>
<p>The post <a href="https://onestringlab.com/complementary-dna/">Belajar Bahasa C &#8211; Complementary DNA</a> appeared first on <a href="https://onestringlab.com">Onestring Lab</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
