Advertisement
mariam65

Untitled

Jun 26th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.95 KB | None | 0 0
  1. #include <cs50.h>
  2. #include <stdio.h>
  3.  
  4. int main (void)
  5.  
  6. {
  7.  
  8.    char hash = '#';
  9.    char space =' ';
  10.    int height = 0;
  11.  {
  12.    do
  13.  {
  14.    printf("height: ");
  15.    int height = get_int();
  16.  
  17.  }
  18.   while
  19.    ( height > 1 && height< 24 );
  20.  
  21.   for
  22.    ( char hash = 0 ; hash > 1 ; hash++ )
  23.     printf (" # %c\n"  ,  hash );
  24.     printf("    %c\n" , space + height);
  25.  
  26.  
  27.    
  28.  }   if ( height < 1 || height > 24)
  29.      printf(" error %c\n" , hash );
  30. }
  31.  
  32.  
  33.  
  34.  
  35.  
  36. ERROR
  37.  
  38.  
  39. mario.c:15:8: error: declaration shadows a local
  40.       variable [-Werror,-Wshadow]
  41.    int height = get_int();
  42.        ^
  43. mario.c:10:8: note: previous declaration is here
  44.    int height = 0;
  45.        ^
  46. mario.c:15:8: error: unused variable 'height'
  47.       [-Werror,-Wunused-variable]
  48.    int height = get_int();
  49.        ^
  50. mario.c:18:2: error: expected 'while' in do/while loop
  51.  {
  52.  ^
  53. mario.c:12:4: note: to match this 'do'
  54.    do
  55.    ^
  56. 3 errors generated.
  57. make: *** [mario] Error 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement