Random Numbers - } /* Same random # every time #include

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <stdio.h> #include <stdlib.h> #include <time.h> void main() { int a,b; time_t t; srand((unsigned)time(&t)); a=rand()%6+1; b=rand()%6+1; printf("%d %d %d\n",a,b,a+b);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } /* Same random # every time #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void main() { int a,b; a=rand(); b=rand(); printf(&quot;%d %d\n&quot;,a,b); } */...
View Full Document

This note was uploaded on 10/05/2011 for the course CS 36 taught by Professor Sethhochwald during the Spring '09 term at Irvine Valley College.

Ask a homework question - tutors are online