Advertisement
dllbridge

Untitled

Jul 24th, 2024
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1.  
  2.  
  3. #include   <stdio.h>
  4. #include  <stdlib.h>
  5.  
  6.    
  7. int foo();
  8.    
  9.  
  10. ////////////////////////////////////////////////////
  11. int main()                                        //
  12. {
  13.        
  14.     foo();  
  15. }
  16.  
  17.  
  18.  
  19. ////////////////////////////////////////////////////
  20. int foo()                                         //
  21. {
  22.        
  23.     #define SIZE 20
  24.    
  25.  
  26.     int nums[SIZE],
  27.                  k;
  28.    
  29.     srand(5);  
  30.    
  31.     for(k = 0; k < SIZE; k++)
  32.     {
  33.     nums[k] = rand()%19;
  34.     printf("%d, ", nums[k]);
  35.     }   printf("\n");
  36.    
  37.     for(k = 19; k >= 0; k--)
  38.     {
  39.     printf("%d, ", nums[k]);
  40.     }   printf("\n");
  41. }
  42.  
  43.  
  44.  
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement