Brooke C.

asked • 11/10/15

This is a CST 295 C++

What is the output of each program segment? 
 
 
A. int i = 0;
while (i++ < 30)
{
if ( i % 7 ) continue;
cout << i << " ";
}
cout << endl;
 
B. enum days {SUN, MON, TUE, WED, THU, FRI, SAT};
days research = FRI;
days busiest = THU;
days football = MON;
cout << research – football + busiest << endl;
 
 
 
C. for (i=0; i<5; i++)
{
for (j=0; j<=i; j++)
cout << "X";
cout << endl;
}
 
 
 
D. int a=0, b=1, c=2, temp;
temp=a; a=b; b=temp;
temp=a; a=c; c=temp;
cout << a << " " << b << " " << c << endl;

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.