Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cs50.h>
- #include <stdio.h>
- int main(void)
- // Get number from user between 1 and 8
- {
- int h;
- do
- {
- h = get_int("height: ");
- }
- while (h <= 0 || h >= 9);
- // Begin the nest loop
- {
- for(int i = 0; i == h; i++);
- {
- for(int j = 0; j = i; j++);
- {
- printf("#");
- }
- printf("\n");
- }
- }
- }
- ERROR
- mario.c:18:30: error: use of undeclared identifier 'i'
- for(int j = 0; j = i; j++);
- ^
- mario.c:16:36: error: for loop has empty body [-Werror,-Wempty-body]
- for(int i = 0; i == h; i++);
- ^
Advertisement
Add Comment
Please, Sign In to add comment