Learn how our autograder works 1 #include 2 3 int main(void) { 4 int givenYear; 5 6 7 8 if(givenYear>-2101) scanf("%d", &givenYear); 9 10) 11 else if(givenYear>-2001) 12 ( 13 printf("21st century\n"); 14) printf("Distant future\n"); Run 15 else if(givenYear>-1901) 16 ( 17 printf("20th century\n"); Failed to compile main.c:11:1: error: expected identifier or (before 'else' 11 else if (givenYear>=2001) main.c:15:1: error: expected identifier or '(before 'else' 15 else if (givenYear>=1901) main.c:19:1: error: expected identifier or (before 'else' 19 | else main.c:23:1: error: expected identifier or '('before '' token Note: Although the reported line number is in the uneditable part of the code, the error actually exists in your code. Tools often don't recognize the problem until reaching a later line. DIDI 0 All passed Feedback?
Learn how our autograder works 1 #include 2 3 int main(void) { 4 int givenYear; 5 6 7 8 if(givenYear>-2101) scanf("%d", &givenYear); 9 10) 11 else if(givenYear>-2001) 12 ( 13 printf("21st century\n"); 14) printf("Distant future\n"); Run 15 else if(givenYear>-1901) 16 ( 17 printf("20th century\n"); Failed to compile main.c:11:1: error: expected identifier or (before 'else' 11 else if (givenYear>=2001) main.c:15:1: error: expected identifier or '(before 'else' 15 else if (givenYear>=1901) main.c:19:1: error: expected identifier or (before 'else' 19 | else main.c:23:1: error: expected identifier or '('before '' token Note: Although the reported line number is in the uneditable part of the code, the error actually exists in your code. Tools often don't recognize the problem until reaching a later line. DIDI 0 All passed Feedback?
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
Could anyone tell me what am I doing wrong with my code ? It's C
![zy Section 3.4 - CIS 161: Introduction X
C In C programming language. | Chegg. +
A
C
□
✰ learn.zybooks.com/zybook/AVCCIS161 McCarySummer2023/chapter/3/section/4?content_resource_id=80162925
zy zyBooks - Build Co... V Vimm's Lair: Preser...
Dashboard
78°F
Windy
=zyBooks My library > CIS 161: Introduction to C Programming home > 3.4: Detecting ranges with branches
Imported From Fire...
Learn how our autograder works
480676.1279990.qx3zqy7
12 {
13 printf("21st century\n");
14}
15 else if(givenYear>=1901)
16 {
17
18}
19 else
20 {
21
22
23 }
24
25
26
27
28}
Run
printf("20th century\n");
printf("Long ago\n");
}
return 0;
Failed to compile
main.c:23:1: error: expected identifier or '('before '' token
23 }
main.c:27:4: error: expected identifier or '('before 'return'
27 |
return 0;
I
main.c:28:1: error: expected identifier or '('before '}' token
28 }
Note: Although the reported line number is in the uneditable part of the code, the error actually exists in your code. Tools often
don't recognize the problem until reaching a later line.
Q Search
O
1 test
passed
All tests
passed
Feedback?
EzyBooks catalog
Help/FAQ
• VPN
Larry Williams
X
|||
2:23 PM
5/31/2023](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F3e035166-c990-4dd0-a7c5-b2c139b07c7d%2Fe226aa5d-4ff9-4f93-a550-ffb7fcc9e526%2Fpxteini_processed.png&w=3840&q=75)
Transcribed Image Text:zy Section 3.4 - CIS 161: Introduction X
C In C programming language. | Chegg. +
A
C
□
✰ learn.zybooks.com/zybook/AVCCIS161 McCarySummer2023/chapter/3/section/4?content_resource_id=80162925
zy zyBooks - Build Co... V Vimm's Lair: Preser...
Dashboard
78°F
Windy
=zyBooks My library > CIS 161: Introduction to C Programming home > 3.4: Detecting ranges with branches
Imported From Fire...
Learn how our autograder works
480676.1279990.qx3zqy7
12 {
13 printf("21st century\n");
14}
15 else if(givenYear>=1901)
16 {
17
18}
19 else
20 {
21
22
23 }
24
25
26
27
28}
Run
printf("20th century\n");
printf("Long ago\n");
}
return 0;
Failed to compile
main.c:23:1: error: expected identifier or '('before '' token
23 }
main.c:27:4: error: expected identifier or '('before 'return'
27 |
return 0;
I
main.c:28:1: error: expected identifier or '('before '}' token
28 }
Note: Although the reported line number is in the uneditable part of the code, the error actually exists in your code. Tools often
don't recognize the problem until reaching a later line.
Q Search
O
1 test
passed
All tests
passed
Feedback?
EzyBooks catalog
Help/FAQ
• VPN
Larry Williams
X
|||
2:23 PM
5/31/2023
![zy Section 3.4 - CIS 161: Introduction X
C In C programming language. | Chegg. +
A
C
□
✰ learn.zybooks.com/zybook/AVCCIS161 McCarySummer2023/chapter/3/section/4?content_resource_id=80162925
zy zyBooks - Build Co... V Vimm's Lair: Preser...
Dashboard
78°F
Windy
=zyBooks My library > CIS 161: Introduction to C Programming home > 3.4: Detecting ranges with branches
Imported From Fire...
Learn how our autograder works
480676.1279990.qx3zqy7
1 #include <stdio.h>
2
3 int main(void) {
4
int givenYear;
5
6
7
8 if(givenYear>=2101)
9 printf("Distant future\n");
10 }
11 else if(givenYear>=2001)
12 {
13 printf("21st century\n");
Run
scanf("%d", &givenYear);
14 }
15 else if(givenYear>=1901)
16 {
17 printf("20th century\n");
Failed to compile
main.c:11:1: error: expected identifier or (before 'else'
11 | else if (givenYear>=2001)
main.c:15:1: error: expected identifier or '('before 'else'
15 else if (givenYear>=1901)
main.c:19:1: error: expected identifier or '('before 'else'
19 | else
main.c:23:1: error: expected identifier or '('before '' token
Note: Although the reported line number is in the uneditable part of the code, the error actually exists in your code. Tools often
don't recognize the problem until reaching a later line.
Q Search
O
►
1 test
passed
All tests
passed
Feedback?
EzyBooks catalog
Help/FAQ
• VPN
Larry Williams
X
|||
2:22 PM
5/31/2023](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F3e035166-c990-4dd0-a7c5-b2c139b07c7d%2Fe226aa5d-4ff9-4f93-a550-ffb7fcc9e526%2Fdiqe69h_processed.png&w=3840&q=75)
Transcribed Image Text:zy Section 3.4 - CIS 161: Introduction X
C In C programming language. | Chegg. +
A
C
□
✰ learn.zybooks.com/zybook/AVCCIS161 McCarySummer2023/chapter/3/section/4?content_resource_id=80162925
zy zyBooks - Build Co... V Vimm's Lair: Preser...
Dashboard
78°F
Windy
=zyBooks My library > CIS 161: Introduction to C Programming home > 3.4: Detecting ranges with branches
Imported From Fire...
Learn how our autograder works
480676.1279990.qx3zqy7
1 #include <stdio.h>
2
3 int main(void) {
4
int givenYear;
5
6
7
8 if(givenYear>=2101)
9 printf("Distant future\n");
10 }
11 else if(givenYear>=2001)
12 {
13 printf("21st century\n");
Run
scanf("%d", &givenYear);
14 }
15 else if(givenYear>=1901)
16 {
17 printf("20th century\n");
Failed to compile
main.c:11:1: error: expected identifier or (before 'else'
11 | else if (givenYear>=2001)
main.c:15:1: error: expected identifier or '('before 'else'
15 else if (givenYear>=1901)
main.c:19:1: error: expected identifier or '('before 'else'
19 | else
main.c:23:1: error: expected identifier or '('before '' token
Note: Although the reported line number is in the uneditable part of the code, the error actually exists in your code. Tools often
don't recognize the problem until reaching a later line.
Q Search
O
►
1 test
passed
All tests
passed
Feedback?
EzyBooks catalog
Help/FAQ
• VPN
Larry Williams
X
|||
2:22 PM
5/31/2023
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education