Advertisement
Guest User

hey

a guest
Mar 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.88 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4.  
  5. void wipe(int puppy[][5], int x);
  6. void populate(int horse[][5], int n);
  7.  
  8. int main (void)
  9. {
  10.    int row, i, j, totalrooms;
  11.  
  12.    int a[row][5];
  13.    wipe(a, row); //whatev happens to puppy happens to a
  14.    populate (a, row);
  15.  
  16.    for (i=0; i<row; i++)
  17.    {
  18.       for (j=0; j<5; j++)
  19.          printf ("%d ",a[i][j]);
  20.      
  21.          printf ("\n");
  22.       }
  23.      
  24.         do{
  25.             printf ("Please enter the number of rooms in the hotel: ");
  26.             scanf (" %d", &totalrooms);
  27.       }while (totalrooms!=20 || totalrooms!=30 || totalrooms!= 40 || totalrooms!=50);
  28.  
  29.       return 0;
  30.    }
  31.  
  32. void wipe(int puppy[][5], int x)
  33.    {
  34.    int i, j;
  35.  
  36.    for (i=0; i<x; i++)
  37.       for(j=0; j<5; j++)
  38.          puppy[i][j] =0;
  39. }
  40.  
  41. void populate(int horse[][5], int n)
  42. {
  43.    int i;
  44.  
  45.    for (i=0; i<n; i++)
  46.       horse[i][0]= (i/10 +1) * 100 + i%10 +1;
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement