Code Example Using /= and ++
# include <stdio.h>
main ( )
{
int num, digits = 0 ;
temp = num = 4327;
while ( temp > 0 )
{ printf (“%d\n”, temp % 5);
temp /= 10 ;
digits++ ;
}
printf (“There are %d digits in %d.\n”, digits, num);
}
Previous slide
Next slide
Back to first slide
View graphic version