Added exercise 3.44
[C-Deitel-Exercises.git] / Chapter-3 / 3-29.c
blob523c0bfdb3532d10fa787d0ac1c48e06d9e5a5ed
1 /*C How to Program, 6/E, Deitel & Deitel.
3 Solution of exercise 3.29:
4 What does the following program print?
6 #include <stdio.h>
8 int main( void )
10 int count = 1;
12 while ( count <= 10 ) {
14 printf( "%s\n", count % 2 ? "****" : "++++++++" );
15 count++;
18 return 0;
21 Written by Juan Carlos Moreno (jcmhsoftware@gmail.com), year 2017. */
23 #include <stdio.h>
25 int main(void)
27 int count = 1; /* initialize count */
29 while (count <= 10)
30 { /* loop 10 times */
31 /* output line of text */
32 printf("%s\n", count % 2 ? "****" : "++++++++");
33 count++; /* increment count */
34 } /* end while */
36 return 0; /* indicate program ended successfully */
37 } /* end function main */