aula 02 (2)
TRANSCRIPT
![Page 1: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/1.jpg)
LINGUAGEM DE PROGRAMAÇÃO I
Aula 2- Exibindo no display
![Page 2: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/2.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Conteúdo Programático desta aula
As funções puts(), putchar() e printf(); Os caracteres de controle; Códigos de formatação; Os operadores aritméticos ;
![Page 3: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/3.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
![Page 4: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/4.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
puts(), putchar() e printf() - Sintaxes
![Page 5: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/5.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
puts(), putchar() e printf() - Exemplos
![Page 6: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/6.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Os caracteres de controle
![Page 7: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/7.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Os caracteres de controle – Exemplo \n
![Page 8: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/8.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Os caracteres de controle – Exemplo \n
![Page 9: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/9.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Os caracteres de controle – Exemplo \t
![Page 10: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/10.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Os caracteres de controle – Exemplo \t
![Page 11: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/11.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Os caracteres de controle – Exemplo \t
![Page 12: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/12.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação
![Page 13: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/13.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %s %c %d %f
![Page 14: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/14.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %s %c %d %f
![Page 15: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/15.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %s %c %d %f
![Page 16: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/16.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %s %c %d %f
![Page 17: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/17.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %s %c %d %f
![Page 18: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/18.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %s %c %d %f
![Page 19: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/19.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %n.df
![Page 20: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/20.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %n.df
![Page 21: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/21.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %n.df
![Page 22: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/22.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %n.df
![Page 23: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/23.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %n.df
% 08.3f
![Page 24: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/24.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %n.df - Exemplo
![Page 25: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/25.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Códigos de formatação %n.df - Exemplo
![Page 26: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/26.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
![Page 27: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/27.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Operadores Aritméticos
![Page 28: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/28.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Operadores Aritméticos - / e %
![Page 29: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/29.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Operadores Aritméticos – Aplicando Conhecimento
Programa da data
Programa do caixa eletrônico
Programa que inverte o número
Programa dos dias, horas minutos e segundos
![Page 30: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/30.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Programa que inverte número - lógica
![Page 31: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/31.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Programa que inverte número - lógica
![Page 32: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/32.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Programa que inverte número - lógica
![Page 33: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/33.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
Programa que inverte número - lógica
![Page 34: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/34.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
![Page 35: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/35.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
1) Se \n é um caracter, podemos usar printf(‘\n’)?
![Page 36: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/36.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
R: Não, pois printf exige uma cadeia de caracteres que fica entre “ ..
1) Se \n é um caracter, podemos usar printf(‘\n’)?
![Page 37: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/37.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
1) Se \n é um caracter, podemos usar printf(‘\n’)?
R: Não, pois printf exige uma cadeia de caracteres que fica entre “ .
2) O recuo que se percebe no código é obrigatório?
![Page 38: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/38.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
R: Não, mas dá maior visibilidade ao código.
2) O recuo que se percebe no código é obrigatório?
1) Se \n é um caracter, podemos usar printf(‘\n’)?
R: Não, pois printf exige uma cadeia de caracteres que fica entre “ .
![Page 39: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/39.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
3) Tanto faz usar printf() ou puts()?
![Page 40: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/40.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
3) Tanto faz usar printf() ou puts()?
R: Não. Somente no caso que se exibe apenas uma string ou um vetor de char.
![Page 41: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/41.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
4) Como se faz para que o operador de divisão efetue uma divisão real com duas constantes inteiras?
3) Tanto faz usar printf() ou puts()?
R: Não. Somente no caso que se exibe apenas uma string ou um vetor de char.
![Page 42: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/42.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I
R: Adicionando um ponto em uma das duas constantes.
3) Tanto faz usar printf() ou puts()?
R: Não. Somente no caso que se exibe apenas uma string ou um vetor de char.
4) Como se faz para que o operador de divisão efetue uma divisão real com duas constantes inteiras?
![Page 43: Aula 02 (2)](https://reader036.vdocuments.pub/reader036/viewer/2022070512/588af0c21a28abf8548b4c97/html5/thumbnails/43.jpg)
Exibindo no display – Aula 2
LINGUAGEM DE PROGRAMAÇÃO I