Question: 1 . Trace the following code with input values: 5 , 8 , 3 , 1 , 4 , 2 . #include using namespace std;

1. Trace the following code with input values: 5,8,3,1,4,2.
#include
using namespace std;
int main()
{ int n=0;
float x1=0, sum=0;
cout<<" How many numbers do you have?"<>n;
while(n >0)
{ cout<<"Enter a number. ";
cin>>x1;
sum = sum + x1;
n = n -1;
}
if ( sum <20)
cout<<"C++ is Great!"<< endl;
else
{ sum = sum -2;
cout<<"I love C++."<

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!