mardi 27 octobre 2015

Trying to write c++ code to generate random genetic code

I wrote this simple program to generate random genetic code comprising of ATGC. I’m pretty sure the code is correct; however, it won’t compile on my system. If someone out there could debug this it would be greatly appreciated.

This is what I have come up with.

simplest code to generate random genetic code

#include "StdAfx.h"
#include <iostream>
#include <cstdlib>
using namespace std;
(int main(
int x = rand();
if {(x % 2 == 0)
(int main(
int y = rand());
if {(y % 2 == 0)
{
cout<<"A\n";}}
else
{
cout<<"T\n";}
}))}
else 
(int main(
int z = rand());
if {(z % 2 == 0)
{
cout<<"G\n";}}
else 
{
cout<<"C\n";}
}))}




Aucun commentaire:

Enregistrer un commentaire