Tips: in the online C compiler, click the "Debug" button to debug the program. Then you can type gdb commands in the Debug Console. #include int main (void) { int i, *p, count = 10; } p = &count; for (i = 5; i >= 0; i--) { } count++; (*p) ++; printf("count return 0; = %d, Have a wonderful day.\n", count); 1. [20 pts] What is the output of the program? Please explain why. 2. [15 pts] What is the gdb command to set a breakpoint in line 6 (p = & count;)? 3. [15 pts] Explain in your own words how the [break ... if expr] command works. When might you need to use such command? Please run and debug the following program and answer the questions.

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter7: String Manipulation
Section: Chapter Questions
Problem 2MQ7
icon
Related questions
Question
Tips: in the online C compiler, click the "Debug" button to debug the program. Then you can type gdb
commands in the Debug Console.
#include <stdio.h>
int main (void)
{
int i, *p, count
= 10;
}
p = &count;
for (i
=
5; i >= 0; i--) {
}
count++;
(*p) ++;
printf("count
return 0;
=
%d, Have a wonderful day.\n", count);
1. [20 pts] What is the output of the program? Please explain why.
2. [15 pts] What is the gdb command to set a breakpoint in line 6 (p
=
& count;)?
3. [15 pts] Explain in your own words how the [break ... if expr] command works. When might you
need to use such command?
Transcribed Image Text:Tips: in the online C compiler, click the "Debug" button to debug the program. Then you can type gdb commands in the Debug Console. #include <stdio.h> int main (void) { int i, *p, count = 10; } p = &count; for (i = 5; i >= 0; i--) { } count++; (*p) ++; printf("count return 0; = %d, Have a wonderful day.\n", count); 1. [20 pts] What is the output of the program? Please explain why. 2. [15 pts] What is the gdb command to set a breakpoint in line 6 (p = & count;)? 3. [15 pts] Explain in your own words how the [break ... if expr] command works. When might you need to use such command?
Please run and debug the following program and answer the questions.
Transcribed Image Text:Please run and debug the following program and answer the questions.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr