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
Get step-by-step solutions from verified subject matter experts
