Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- void wipe(int puppy[][5], int x);
- void populate(int horse[][5], int n);
- int main (void)
- {
- int row, i, j, totalrooms;
- int a[row][5];
- wipe(a, row); //whatev happens to puppy happens to a
- populate (a, row);
- for (i=0; i<row; i++)
- {
- for (j=0; j<5; j++)
- printf ("%d ",a[i][j]);
- printf ("\n");
- }
- do{
- printf ("Please enter the number of rooms in the hotel: ");
- scanf (" %d", &totalrooms);
- }while (totalrooms!=20 || totalrooms!=30 || totalrooms!= 40 || totalrooms!=50);
- return 0;
- }
- void wipe(int puppy[][5], int x)
- {
- int i, j;
- for (i=0; i<x; i++)
- for(j=0; j<5; j++)
- puppy[i][j] =0;
- }
- void populate(int horse[][5], int n)
- {
- int i;
- for (i=0; i<n; i++)
- horse[i][0]= (i/10 +1) * 100 + i%10 +1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement