14.03.2015 Views

Apostila C da UFMG - Universidade do Minho

Apostila C da UFMG - Universidade do Minho

Apostila C da UFMG - Universidade do Minho

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

. i= 10 i= 20 i=10 i= 30<br />

c. i= 20 i=10 i=10 i=30<br />

d. i= 10 i=10 i=10 i=10<br />

e. Nenhuma <strong>da</strong>s opções anteriores<br />

8- Ao se utilizar um vetor como parâmetro para uma função que informação está sen<strong>do</strong> passa<strong>da</strong> à função?<br />

a. Uma cópia de to<strong>do</strong>s elementos <strong>do</strong> vetor<br />

b. Uma cópia <strong>do</strong> primeiro elemento <strong>do</strong> vetor<br />

c. O endereço <strong>do</strong> primeiro elemento <strong>do</strong> vetor<br />

d. O endereço de to<strong>do</strong>s os elementos <strong>do</strong> vetor<br />

e. Nenhuma <strong>da</strong>s opções anteriores<br />

9- Sejam par1, par2 e par3 variáveis inteiras. Se chamarmos uma função pela instrução:<br />

func(&par1,&par2,&par3);<br />

Para que servem &par1, &par2 e &par3 ?<br />

a. São valores inteiros passa<strong>do</strong>s para a função<br />

b. Servem para armazenar os endereços <strong>da</strong> função e <strong>da</strong>s funções que chamaram<br />

c. São os endereços <strong>da</strong>s variáveis <strong>da</strong> função que chamou. Nestes endereços iremos armazenar os<br />

valores a serem modifica<strong>do</strong>s pela função<br />

d. Armazenam os endereços <strong>da</strong>s funções de biblioteca usa<strong>do</strong>s na função<br />

e. Nenhuma <strong>da</strong>s opções anteriores<br />

10- O que imprime o programa a seguir?<br />

#include <br />

func(int *a, int b)<br />

{<br />

int temp;<br />

temp = *a;<br />

*a = b;<br />

b = temp;<br />

}<br />

void main()<br />

{<br />

int a = 10, b = 20;<br />

func(&a, b);<br />

printf("a = %d, b = %d", a, b);<br />

}<br />

a. a = 10, b = 20<br />

b. a = 20, b = 10<br />

c. a = 10, b = 10<br />

d. a = 20, b = 20<br />

e. Nenhuma <strong>da</strong>s opções anteriores<br />

Resposta <strong>do</strong>s testes Aulas 5 e 6:<br />

1-c 2-b 3-d 4-b 5-a 6-e 7-b 8-c 9-c 10-d<br />

Aula 8<br />

Pág. 57

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!