Exercise 3.13 (Deitel: C How to Program 6th Edition) What does the following program print? 1 #include <stdio.h>23 int main( void )4 {5 int x = 1, total = 0, y;67 while ( x <= 10 ) {8 y = x * x;9 printf( "%d\n", y );10 total += y;11 ++x;12 } /* end while */1314 printf("Total is %d\n", total);15 return 0;16 } /* end main */ Output:
0 komentar:
Posting Komentar