C Language: Loop Text with Random Color Combination
<p>The following test fails because "system("color #code);" needs to be static.
For example:-</p>

<p><code>system("color 0F");</code> Works.</p>

<p><code>system("color %d %d",a, b);</code> Does Not.</p>

<p>Complete Code:</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;conio.h&gt;
#include &lt;time.h&gt;
#include &lt;stdlib.h&gt;

int main() 
{
char R[15]={'1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};

    while(1)
    {
    srand(time(NULL));
    int Ra = rand() %10 + 6;
    int Rb = rand() %10 + 6;

    system("color %c%c",R[Ra], R[Rb]);  

    printf("Hello world!");
    system("cls");
    };

return 0;
}
</code></pre>

<p>How do I get this to work? Is there a better way?</p>