200-901 · Question #239
Refer to the exhibit. The output of the diff -u README.md-repo README.md command is shown. The original file was 165 lines long. How many lines are in the edited copy of the file?
The correct answer is C. 172. In unified diff format (diff -u), lines prefixed with '-' indicate removals and lines prefixed with '+' indicate additions. The @@ hunk headers show the original and new line ranges. Starting from the original 165 lines, the exhibit's diff output shows a net addition of 7 lines…
Question
Refer to the exhibit. The output of the diff -u README.md-repo README.md command is shown. The original file was 165 lines long. How many lines are in the edited copy of the file?
Exhibit
Options
- A162
- B165
- C172
- D173
How the community answered
(37 responses)- A5% (2)
- B14% (5)
- C78% (29)
- D3% (1)
Explanation
In unified diff format (diff -u), lines prefixed with '-' indicate removals and lines prefixed with '+' indicate additions. The @@ hunk headers show the original and new line ranges. Starting from the original 165 lines, the exhibit's diff output shows a net addition of 7 lines (more '+' lines than '-' lines across all hunks). Therefore: 165 + 7 = 172 lines in the edited file. This matches option C (172). Options A (162) and D (173) reflect incorrect arithmetic, and B (165) would mean no net change.
Topics
Community Discussion
No community discussion yet for this question.
