Question: What is the output of the following program: #include using namespace std; int fun(int data); int main() { int data = 3; data =

 What is the output of the following program: #include using namespace std;  

What is the output of the following program: #include using namespace std; int fun(int data); int main() { int data = 3; data = fun(data); cout < < "data is " < < data < < endl; return 0; } int fun(int data) { int x = 8, sum= = 0; while (--x) { sum += x; if (x %3 == 0) break; } return ++sum; Select one: a. data is 13. b. error c. data is 141 d. data is 21

Step by Step Solution

3.54 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The image youve provided contains a sample of a C program and multiple choice answers labeled a b c ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!