FMU - TECNOLOGIA EM DESENVOLVIMENTO ANALISE DE SISTEMAS CLÓVIS DE OLIVEIRA - RA 523.728-7 _______________________________________________________________________________________________ EXERCICIO 39 ============ #include int main () { int v_nro; clrscr (); v_nro = 1; printf (" Demonstrar o funcionamento do comando while"); printf (" \n \n "); while (v_nro < 21) { printf (" Resultado do while: %d", v_nro); printf (" \n "); v_nro = v_nro + 1; } getch (); return 0; } _______________________________________________________________________________________________ EXERCICIO 40 ============ #include int main () { int v_dividendo; int v_divisor; int v_resto; clrscr (); v_dividendo = 20; v_divisor = 2; printf (" Demonstrar o funcionamento do comando while"); printf (" \n \n "); while (v_dividendo > 0) { v_resto = v_dividendo % v_divisor; if (v_resto == 0) { printf (" Resultado do while par: %d",v_dividendo); printf (" \n "); v_dividendo = v_dividendo - 1; } else { v_dividendo = v_dividendo - 1; } } getch (); return 0; } _______________________________________________________________________________________________ EXERCICIO 41 ============ #include int main () { int v_dividendo; int v_divisor; int v_resto; clrscr (); v_dividendo = 20; v_divisor = 2; printf (" Demonstrar o funcionamento do comando while"); printf (" \n \n "); while (v_dividendo > 0) { v_resto = v_dividendo % v_divisor; if (v_resto == 0) { printf (" Este numero eh par : %d", v_dividendo); } else { printf (" Este numero eh impar: %d", v_dividendo); } printf (" \n "); v_dividendo = v_dividendo - 1; } getch (); return 0; }