Question: Q5) a)What does the following program display? #include int main( void ) { int y; int x = 2; int total = 10; while (

Q5) a)What does the following program display?

#include

int main( void ) { int y; int x = 2; int total = 10;

while ( x <= 8 ) {

y = x * x ; printf( "%d ", y ); total += y; ++x; }

printf( "The total is %d ", total );

} Trace Table:

b)Trace and find the output of following segment int main() { for ( int k=1; k<=15;k++) { if ( k % 5= = 0 ) break; printf(%d,k); } printf(End of Semester :) );

}

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!