Kevin321888999

Lab 5 part D

Apr 27th, 2022
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main(void){
  6. srand(time (NULL));
  7.   int Run= 10;
  8.   int one=0;
  9.   int six=0;
  10.  
  11.  
  12.   printf("Run|| Ones|| Sixes\n");
  13.   printf("----------------------------------\n");
  14.   for (int i=1; i<=Run; i++){
  15.     one= rand()%20;
  16.     six= rand()%20;
  17.   if(one==1){one++;}
  18.   if(six==6){six++;}
  19.    
  20.     printf("%2i:   %2i:     %i\n",i,one,six);
  21.  
  22.  
  23.   }printf("----------------------------------\n");
  24.    
  25.    printf("Ones:%i, Sixes:%i", one, six);
  26.  
  27.  
  28.  
  29.   return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment