Buscar

AED - Aula 9

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Você viu 3, do total de 61 páginas

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Você viu 6, do total de 61 páginas

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Você viu 9, do total de 61 páginas

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Prévia do material em texto

���������	
�
�	��
�
��	
��
����	
�
������
������������	������������	
����
�
����	�
����	
�����
��
����
�����
��
����
��
����
��
�	�
�������
������
� ��	�
�������
������
� �
�����	
�����	
!��!�����	!��!�����	 !���!��� �����
"������
�����
"������
#��$%�#��$%�
���$�������
������
� ����$�������
������
� �
��������������	������������	 && 		%�
�	��
�
��	
'
�
���
!��

�
%�
�	��
�
��	
'
�
���
!��

�
���(
���
��
�������	)
'
�
	%�
�*��
����	
'
����
�
���(
���
��
�������	)
'
�
	%�
�*��
����	
'
����
�
!�����������
+
�,������!�����������
+
�,������
���
����	
�
����	
&& 	%�
!�����������	
'
�
��������

�
$����
��
	%�
!�����������	
'
�
��������

�
$����
��
������������	
�
�
����	������������	
�
�
����	������������	
�
�
����	������������	
�
�
����	
���
����	
�
����	
&& 	%�
!�����������	
'
�
��������

�
$����
��
	%�
!�����������	
'
�
��������

�
$����
��
	�
�+������	�
�+������
�� �
"���
����
�
�%�
��-
��	����%���
"���
����
�
�%�
��-
��	����%��
���'
�

����-��
!�����������	
�
�
����	.���'
�

����-��
!�����������	
�
�
����	.���'
�

����-��
!�����������	
�
�
����	.���'
�

����-��
!�����������	
�
�
����	.
�� �$����
'
�
�	
 ����	
��
!�������
��'
��
�$����
'
�
�	
 ����	
��
!�������
��'
��
������	
������	
�����	�����	 �
���	
���/���	
��
���
�
����������
���	
���/���	
��
���
�
���������
�� �(
���
�
�(
���
�
������-��������-�� �
!��������
!���������
����������
��������
���!��$������������!��$��������� ��
�0����	
���	��
/��	
��
�0����	
���	��
/��	
����������������������������
�� �$����
��!����%��$����
��!����%� ��
����,�	
��
�0����	)
������-����
��
����,�	
��
�0����	)
������-����
����	
�
�����������
���������	�����	
�
�����������
���������	�
<tipo> nome_da_função (<tipo> arg1, <tipo> arg2, ..., 
<tipo> argN)
{
<tipo> nome_da_função (<tipo> arg1, <tipo> arg2, ..., 
<tipo> argN)
{
�
����	�
����	
11
����
��������11
����
��������
�
����	�
����	
11
����
��������11
����
��������
{
<corpo da função>
return valor_de_retorno;
}
{
<corpo da função>
return valor_de_retorno;
}
int soma(int a, int b)
{
int soma(int a, int b)
{
���*��!��
��

��
�
��%�1�*��!��
��

��
�
��%�1
�
����	�
����	
11
����
��������11
����
��������
�
����	�
����	
11
����
��������11
����
��������
{
int c;
c = a + b;
return c;
}
{
int c;
c = a + b;
return c;
}
int soma(int a, int b)
{
int soma(int a, int b)
{
�
����	�
����	
11
����
��������11
����
��������
�
����	�
����	
11
����
��������11
����
��������
2���
�
��%�
2���
�
��%�
��$�
���

�
��!���$�
���

�
��!� 3�,��)
3�,��)
���)
�����4)
�
'
��
�������5
�
��!�
��
���)
�����4)
�
'
��
�������5
�
��!�
��
	�
$����
��
�������
3	�
$����
��
�������
3	�/��	�/��4�4�
6	
���
�����	
3�
!��7�����	4
6	
���
�����	
3�
!��7�����	4
�������
�
�������
�
��!�
�
'
��	
$�����	
��!�
�
'
��	
$�����	
	%�
�	!�����	
!���
	%�
�	!�����	
!���
	����
����!
����	
!���
�
��%�
3	����
����!
����	
!���
�
��%�
3��������������4�4�
{
int c;
c = a + b;
return c;
}
{
int c;
c = a + b;
return c;
}
���!�
��
�
��%����!�
��
�
��%�
int random()int random()
��8��
�
��%�
8��
�
��%�
!���
�%�
���
���
�����	!���
�%�
���
���
�����	)
 �	��
)
 �	��
�%�
������5�%�
������599��	�
�*��!��1��	�
�*��!��1
�
����	�
����	
11
����
��������11
����
��������
�
����	�
����	
11
����
��������11
����
��������
int random()
{
srand(time(NULL));
return (rand() % 100);
}
int random()
{
srand(time(NULL));
return (rand() % 100);
}
�� �
�*!��		%�
�������
��
�������
�
�*!��		%�
�������
��
�������
returnreturn +
�,�����
+
�,�����
��
��
$����
��
�������$����
��
������� ��
�
��%����
�
��%��
�� �		�
�������
+
	��!��
�
�		�
�������
+
	��!��
�
:�����
�
	��
�*��
����:�����
�
	��
�*��
���� !��
!��

��
�
��%��
;���
�!0	
���
	��5
�*��
�����
��
�
��%��
;���
�!0	
���
	��5
�*��
�����
�
����	�
����	
11
����
��������11
����
��������
�
����	�
����	
11
����
��������11
����
��������

��
�
��%��
;���
�!0	
���
	��5
�*��
�����
��
�
��%��
;���
�!0	
���
	��5
�*��
�����
�� �	
�
����	
	0
!����
	��
���������	
����
��
�
���	
�	
�
����	
	0
!����
	��
���������	
����
��
�
���	
�
����	�
"�� ���
����	�
"�� ��99	�
'
�
�
���!�
��
!�������
!�����!��
	�
'
�
�
���!�
��
!�������
!�����!��
33main()main()4
+

��
�
��%�<4
+

��
�
��%�<
��8��
�����
��5		���
��
�����-����	
�
��$����%�
3�
8��
�����
��5		���
��
�����-����	
�
��$����%�
3�
�,�����4
��

��
�
��%�
+
���� 
����
�
	�
$����
�
�,�����4
��

��
�
��%�
+
���� 
����
�
	�
$����
�

��
$���5$��1
��
$���5$��1
resultado = soma(x,y);resultado = soma(x,y);
�
����	�
����	
11
��$������11
��$������
�
����	�
����	
11
��$������11
��$������
��;�
$������)
�
��	
�����
��
�,�����
��

��
�
��%�
+
;�
$������)
�
��	
�����
��
�,�����
��

��
�
��%�
+

��
�*!��		%�)
'
�
!���
	��

	���
��
'
��'
��
�
���

��
�*!��		%�)
'
�
!���
	��

	���
��
'
��'
��
�
���
'
�
������

��
�*!��		%�1'
�
������

��
�*!��		%�1
printf("Soma: %d\n", soma(a,b) );printf("Soma: %d\n", soma(a,b) );
int x, y, resultado;
int soma(int a, int b){
return (a + b);
int x, y, resultado;
int soma(int a, int b){
return (a + b);
�
����	�
����	
11
��$������11
��$������
�
����	�
����	
11
��$������11
��$������
���
��%�
'
�
����
��
�
	���
��	
$�����	
��
*
�
=1�
��%�
'
�
����
��
�
	���
��	
$�����	
��
*
�
=1
}
int main(){
x = 3;
y = 5;
resultado = soma(x, y);
printf("%d\n", resultado);
}
}
int main(){
x = 3;
y = 5;
resultado = soma(x, y);
printf("%d\n", resultado);
} >?
�� �	
$���5$��	
�	
$���5$��	
** �
�
== ��
�*��!��
��������
	%�
�,�����	
��
��
�*��!��
��������
	%�
�,�����	
��
!��7�����	
����	!��7�����	
����	��
�� ��������
�*��!��
��������)
�	
���
�����	
��������
�*��!��
��������)
�	
���
�����	
�%�
�%�
!�		
��
����		���������
�	
��	��	
����	!�		
��
����		���������
�	
��	��	
����	 '
�
�	
'
�
�	
�
����	�
����	
11
��$������11
��$������
�
����	�
����	
11
��$������11
��$������
!�		
��
����		���������
�	
��	��	
����	!�		
��
����		���������
�	
��	��	
����	 '
�
�	
'
�
�	
!��7�����	
'
�
�
�
��%�
�	!����!��7�����	
'
�
�
�
��%�
�	!����
�� ��
	
$�����	
	%�
�!���	
��!����	
!���
�
�
��%�
��
	
$�����	
	%�
�!���	
��!����	
!���
�
�
��%�
�,�����)
�,�����)
	��
	��
�������	
!���	
���������		��
	��
�������	
!���	
���������	 ��	
��	
!��7�����	
������
��
�
��%��!��7�����	
������
��
�
��%��
6
��!�
6
��!�
voidvoid6
��!�
6
��!�
voidvoid
��@

����-���
��
@

����-���
��
!�����������	!�����������	��
��@

�
��!�
'
�
��!��	����
�
A����B)
�
	�(�1@

�
��!�
'
�
��!��	����
�
A����B)
�
	�(�1
�� 
��

��
$���5$��$���5$�� ��		�
��!�
��		�
��!�
����-�������-��� �����:��
�����:��
�������������)
�������������)
�� 
��

��
�
��%��
��%� ��		�
��!�
��		�
��!�
�������������� 
�
�����:��

�
�����:��
����������������������������
��������
'
�

��
�
��%�
������
'
�

��
�
��%�
�%�
�������
���,
�
�%�
�������
���,
�
$����$����)
�
	�(�)
+

�
!������������)
�
	�(�)
+

�
!������������
void nome_do_procedimento (<tipo> parâmetro1, 
<tipo> parâmetro2, ..., <tipo> parâmetroN)
void nome_do_procedimento (<tipo> parâmetro1, 
<tipo> parâmetro2, ..., <tipo> parâmetroN)
������������	������������	
11
����
��������11
����
��������
������������	������������	
11
����
��������11
����
��������
<tipo> parâmetro2, ..., <tipo> parâmetroN)
{
<corpo do procedimento>
}
<tipo> parâmetro2, ..., <tipo> parâmetroN)
{
<corpo do procedimento>
}
void imprime_dobro(int x) 
{
printf("Dobro de x: %d", 2*x);
void imprime_dobro(int x) 
{
printf("Dobro de x: %d", 2*x);
���*��!��
��
!�����������1�*��!��
��
!�����������1
������������	������������	
11
����
��������11
����
��������
������������	������������	
11
����
��������11
����
��������
printf("Dobro de x: %d", 2*x);
}
printf("Dobro de x: %d", 2*x);
}
������
��$������	

�
!�����������)
��$���	

����-5����
��$������	

�
!�����������)
��$���	

����-599��
��
����
'
��'
��
�
���
�������1����
'
��'
��
�
���
�������1
procedimento(parâmetros);procedimento(parâmetros);
������������	������������	
11
��$������11
��$������
������������	������������	
11
��$������11
��$������
�� ���!���
�
���������
��
��$����%�
��

��
�
��%�1���!���
�
���������
��
��$����%�
��

��
�
��%�1
resultado = função(parâmetros);resultado= função(parâmetros);
int x, y, resultado;
void soma() 
{
resultado = x + y;
}
int x, y, resultado;
void soma() 
{
resultado = x + y;
}
������������	������������	
11
��$������11
��$������
������������	������������	
11
��$������11
��$������
}
int main() 
{
x = 3; 
y = 5;
soma();
printf("%d\n", resultado);
}
}
int main() 
{
x = 3; 
y = 5;
soma();
printf("%d\n", resultado);
}
>C
��@

��
�
��%�
�	!�����
��$�����
�
�������������
!���
@

��
�
��%�
�	!�����
��$�����
�
�������������
!���
	�	����
�!���������
36�4
��
�������
�
!��������	�	����
�!���������
36�4
��
�������
�
!��������
��D
����

����-���)
�
�������
D
����

����-���)
�
�������
returnreturn �������
��
6�
	�
�������
��
6�
	�
�
!�������
�
������
������������
�
�%��
�
!�������
�
������
������������
�
�%��
�
�
��%�
�
�
��%�
main()main()�
�
��%�
�
�
��%�
main()main()
�
!�������
�
������
������������
�
�%��
�
!�������
�
������
������������
�
�%��
��6
!���%�
+
'
�

�
!�������
�������16
!���%�
+
'
�

�
!�������
�������1
�� E
-���E
-��� && ��	�
���,�
�
��������
��	�
���,�
�
��������
������������������������ ))
�� F
F
-���-��� && ��	�
�����5������	�
�����5����
���
����	
�
!�����������	
!����
	��
��������	
����	
�
�
����	
�
!�����������	
!����
	��
��������	
����	
�
��!��	
��
�
��%�
��!��	
��
�
��%�
main()main()��
�� ��
�� �	
�	
��	�	)
�	
�
����	
�G�
!�����������	
��
�� �	
�	
��	�	)
�	
�
����	
�G�
!�����������	
��$��
	��
���������	
����	
��$��
	��
���������	
����	
��
�
��%�
��
�
��%�
main()main()��
��������%�
��
�
����	
�
!�����������	
��������%�
��
�
����	
�
!�����������	
	��
������	��
������99��	��	
��������%�
��
�
����	
�
!�����������	
��������%�
��
�
����	
�
!�����������	
	��
������	��
������99��	��	
��$��
	��
���������	
����	
��$��
	��
���������	
����	
��
�
��%�
��
�
��%�
main()main()��
��6
���(
���
��
�������	
'
�
���	���
��

��
�
��%�
�
6
���(
���
��
�������	
'
�
���	���
��

��
�
��%�
�
!�����������
!���
	��
!�����������
!���
	��
��������
��
'
��'
��
�
���
��
��������
��
'
��'
��
�
���
��
!�������!��������
�
������
��������

��
�
��%�
	��
����������
��������

��
�
��%�
	��
������99��
3�	!��������
	�
��
3�	!��������
	�
�0����4)
	
 	���
/��	
�	
�,�$�	
�
	�
�����:��
!��
�0����4)
	
 	���
/��	
�	
�,�$�	
�
	�
�����:��
!��
!����!����99��99$/��
���$/��
���
��������%�
��
�
����	
�
!�����������	��������%�
��
�
����	
�
!�����������	
	��
������	��
������99��	��	
��������%�
��
�
����	
�
!�����������	��������%�
��
�
����	
�
!�����������	
	��
������	��
������99��	��	
<tipo> nome (<tipo> parâmetro1, <tipo> 
parâmetro2, ..., <tipo> parâmetroN);
<tipo> nome (<tipo> parâmetro1, <tipo> 
parâmetro2, ..., <tipo> parâmetroN);
>H
��8��
$���5$��
+
�,�����
8��
$���5$��
+
�,�����
���������� '
����
+
'
����
+
���������
���������
������
��

��
�
��%�������
��

��
�
��%��
;�		�
��	�1�
;�		�
��	�1
�� ���
���
�*�	��
�!���	
������
��
�
��%�
�*�	��
�!���	
������
��
�
��%�
'
�
�
����+��'
�
�
����+��
�� �!0	
�
�+�����
��
�*��
�%�
��
�
��%�)
���
���*�
��
�*�	�����!0	
�
�+�����
��
�*��
�%�
��
�
��%�)
���
���*�
��
�*�	����
I���5$��	
�����	
�
��� ��	I���5$��	
�����	
�
��� ��	I���5$��	
�����	
�
��� ��	I���5$��	
�����	
�
��� ��	
��8��
$���5$��
+
�,�����
8��
$���5$��
+
�,�����
��� ����� �� '
����
+
'
����
+
���������
����
���������
����
��
'
��'
��
�
��%���
'
��'
��
�
��%��
;�		�
��	�1�
;�		�
��	�1
�� ����
	��
���		���
��
����
	��
���		���
��
'
��'
��
!����'
��'
��
!���� ��
!����������
!��������
�� ���
�*�	��
�
�����
����
�
�*��
�%�
��
!�����������
�*�	��
�
�����
����
�
�*��
�%�
��
!��������
?�
��J��
!�5����
��
!��������%�1J��
!�5����
��
!��������%�1
�� ��$���$�99	�
	�
�$����
�

	�
��
$���5$��	
��� ��	�$����
�

	�
��
$���5$��	
��� ��	��
�� �	
�
����	
��$��
���������
�!���	
�	
	
�	
$���5$��	
�	
�
����	
��$��
���������
�!���	
�	
	
�	
$���5$��	
�����	
�
�	
$���5$��	
!�		���	
�
���	
����
�����	
�
�	
$���5$��	
!�		���	
�
���	
����
!��7�����	�!��7�����	�
I���5$��	
�����	
�
��� ��	I���5$��	
�����	
�
��� ��	I���5$��	
�����	
�
��� ��	I���5$��	
�����	
�
��� ��	
!��7�����	�!��7�����	�
��6
�	��!�
��

��
$���5$��
���������
��
'
�
!����	
��
6
�	��!�
��

��
$���5$��
���������
��
'
�
!����	
��
�0����
���
!���
	��
���		�����0����
���
!���
	��
���		����
�� �
�����
��
�	��!�
��
�
+
 ��
	��!��	1�
�����
��
�	��!�
��
�
+
 ��
	��!��	1
�� �	
$���5$��	
�	
$���5$��	
��� ��	��� ��	 	%�
$�	/$��	
!��
����	
�	
�
����	�	%�
$�	/$��	
!��
����	
�	
�
����	�
�	��!�
��
$���5$��	�	��!�
��
$���5$��	�	��!�
��
$���5$��	�	��!�
��
$���5$��	
�� �	
$���5$��	
�	
$���5$��	
��� ��	��� ��	 	%�
$�	/$��	
!��
����	
�	
�
����	�	%�
$�	/$��	
!��
����	
�	
�
����	�
�� �	
$���5$��	
�	
$���5$��	
�����	�����	 	%�
$�	/$��	
�!���	
��
�
��%�
����
�����
	%�
$�	/$��	
�!���	
��
�
��%�
����
�����
���������	����������	�
�	��!�
��
$���5$��	�	��!�
��
$���5$��	�	��!�
��
$���5$��	�	��!�
��
$���5$��	
��@
!�		/$��
��������
$���5$��	
�����	
���
�
@
!�		/$��
��������
$���5$��	
�����	
���
�
��	��
����
��
$���5$��	
��� ��	���	��
����
��
$���5$��	
��� ��	�
��;�	��
	��
��%�)
�
;�	��
	��
��%�)
�
$���5$��
�����
A�	�����B
�
$���5$��
�����
A�	�����B
�
$���5$��
��� ��$���5$��
��� ����
int nota;
void funcao() 
{
int nota;
// Neste ponto, nota eh variavel local.
}
int nota;
void funcao() 
{
int nota;
// Neste ponto, nota eh variavel local.
}
?�
I���5$��	
�
���5����	
I���5$��	
�
���5����	
KK �	�5����	�	�5����	I���5$��	
�
���5����	
I���5$��	
�
���5����	
KK �	�5����	�	�5����	
��I���5$��	
���������	
������
��

��
�
��%�
3�����	4
I���5$��	
���������	
������
��

��
�
��%�
3�����	4
�L�
�L�
�*�	�L����
�!���	
��'
����
�
�
��%�
�	�5
	����
�*�	�L����
�!���	
��'
����
�
�
��%�
�	�5
	����
�*��
�����*��
����)
���*����
��
�*�	���
'
����
�
�
��%�
�������
)
���*����
��
�*�	���
'
����
�
�
��%�
�������
	
�
�������	
�
�������
��2��
������	��
+
�,�����
2��
������	��
+
�,�����
!��,�
��
�*��
�%�!��,�
��
�*��
�%�11
���� �
!��,�
��
�*��
�%�
�	�5
$�-��M�
!��,�
��
�*��
�%�
�	�5
$�-��M
���� ��
��
�������
�
�*��
�%�
��

�
 �����������
�
�*��
�%�
��

�
 ���� NONO)
�	
$���5$��	
	%�
)
�	
$���5$��	
	%�
��!��,���	��!��,���	 P
������
��
'
�
	%�
������	MP
������
��
'
�
	%�
������	M
Q�Q� ��
��
���������� ��

�
 ����
NO)
�		�	
$���5$��	
	%�
��

�
 ����
NO)
�		�	
$���5$��	
	%�
��	��!��,���	��	��!��,���	)
)
�� ������
�	!���
��
���0������ ������
�	!���
��
���0����
���*��!��1�*��!��1
�� ���	�����

�
!�����������
'
�
	��!������

��
���	�����

�
!�����������
'
�
	��!������

��
����%�����%�
�� �
����%�
+
�
������
��

�
$����
��
���	
��������	1�
����%�
+
�
������
��

�
$����
��
���	
��������	1
I���5$��	
�
���5����	
I���5$��	
�
���5����	
KK �	�5����	�	�5����	I���5$��	
�
���5����	
I���5$��	
�
���5����	
KK �	�5����	�	�5����	
�� !�	��%�
�1!�	��%�
�1 �
����
�
�
��������
����
�
�
�������
�� !�	��%�
�1!�	��%�
�1 �
����
�
������������
����
�
�����������
�� �
����%�
+
	��!��������
��$�������
����%�
+
	��!��������
��$������99	�
����
��������
	�
����
��������
!���
�5*���
��$�	��
���
�!���
�5*���
��$�	��
���
�
void simplifica(int f[]) {
int num, den;
num = f[0];
den = f[1];
while (den) // Equivale a (den != 0)
{
void simplifica(int f[]) {
int num, den;
num = f[0];
den = f[1];
while (den) // Equivale a (den != 0)
{
��
I���5$��	
�
���5����	
I���5$��	
�
���5����	
KK �	�5����	�	�5����	I���5$��	
�
���5����	
I���5$��	
�
���5����	
KK �	�5����	�	�5����	
{
int resto;
resto = num % den;
num = den;
den = resto;
}
f[0] = f[0]/num;
f[1] = f[1]/num;
}
{
int resto;
resto = num % den;
num = den;
den = resto;
}
f[0] = f[0]/num;
f[1] = f[1]/num;
}
JJ
��
��
��
���
�
�
JJ
���
�
�
��	��
����	
��
����
R,���1 ������
��
����
R,���1
I���5$��	
�
���5����	
I���5$��	
�
���5����	
KK �	�5����	�	�5����	
11
���
��%�
��
!��,�
��
�*��
�%�11
���
��%�
��
!��,�
��
�*��
�%�
I���5$��	
�
���5����	
I���5$��	
�
���5����	
KK �	�5����	�	�5����	
11
���
��%�
��
!��,�
��
�*��
�%�11
���
��%�
��
!��,�
��
�*��
�%�
���
��
���
�
�
���
���!0	
�
����
R,���1 ��!��	
��
!�����������1
�� �	
�	
$���5$��	
�����	$���5$��	
�����	 ��� +�
	%�
���,�����	
����
��� +�
	%�
���,�����	
����
$���5$���
���5����	$���5$��	
�
���5����	)
!��
	����
������	
�
��	��
/��	
)
!��
	����
������	
�
��	��
/��	
	��!��
'
�
�
�
��%�
���
�*��
�����	��!��
'
�
�
�
��%�
���
�*��
�����
����
,�
$��

��
���� 
��%�
��
$����
�

��
$���5$��
��
,�
$��

��
���� 
��%�
��
$����
�

��
$���5$��
������
��

��
�
��%�)
���
	��5
�����-���
������
��

��
�
��%�)
���
	��5
�����-���
����	
�	
$�-�	����	
�	
$�-�	
I���5$��	
�
���5����	
I���5$��	
�
���5����	
KK �	�5����	�	�5����	I���5$��	
�
���5����	
I���5$��	
�
���5����	
KK �	�5����	�	�5����	
������
��

��
�
��%�)
���
	��5
�����-���
������
��

��
�
��%�)
���
	��5
�����-���
����	
�	
$�-�	����	
�	
$�-�	
��
'
�
�		�
�
��%�
���
�,��������
'
�
�		�
�
��%�
���
�,������
������
'
�

��
�
��%�
�%�
��	��
�

��
$���5$��
�����
��
����
'
�

��
�
��%�
�%�
��	��
�

��
$���5$��
�����
��
�����
��
�*��
�%�)
+
!����	�
������5�����
��
�*��
�%�)
+
!����	�
������599��
����
�	�5�������
����
�	�5�����
������

��
$���5$��
�	�5����)
�
���� 
��%�
��
$����
�������
����

��
$���5$��
�	�5����)
�
���� 
��%�
��
$����
�������
��������
��������
	������

��
$�-)
'
����
�
$���5$��
+
������	������

��
$�-)
'
����
�
$���5$��
+
��������
I���5$��	
�
���5����	
I���5$��	
�
���5����	
KK �	�5����	�	�5����	I���5$��	
�
���5����	
I���5$��	
�
���5����	
KK �	�5����	�	�5����	
�� ��
�����5���
��	
$���5$��	
��� ��	)
�	
$���5$��	
�	�5����	
��
�����5���
��	
$���5$��	
��� ��	)
�	
$���5$��	
�	�5����	
	0
!����
	��

	���	
������
��
�
��%�	0
!����
	��

	���	
������
��
�
��%� '
�
�	
��������'
�
�	
��������
?��
�����7�����	
�
���
�����	
	%�
�	
$�����	
���� ���	
���7�����	
�
���
�����	
	%�
�	
$�����	
���� ���	
�G�
���������	
!��

��
�
��%���G�
���������	
!��

��
�
��%��
�������
	��
��$�����	
��
�
�	
���������	1�����
	��
��$�����	
��
�
�	
���������	1
���7�����	���7�����	���7�����	���7�����	
�� ������	1������	1 �����	!�����
��	
!��7�����	

����-���	
��
�������%�
�����	!�����
��	
!��7�����	

����-���	
��
�������%�
��
�
��%����
�
��%��
�� S���	1S���	1 �����	!�����
��	
!��7�����	
��
�
��%�
�,�������
�����	!�����
��	
!��7�����	
��
�
��%�
�,�������

����-���	
!���
�,����
�
�
��%��
����-���	
!���
�,����
�
�
��%��
int soma(int a, int b)
{
return (a + b);
}
int soma(int a, int b)
{
return (a + b);
}
���7�����	
������	���7�����	
������	
���7�����	���7�����	���7�����	���7�����	
int main() 
{
int x = 3; 
int y = 5;
printf("%d\n", soma(x + y));
}
int main() 
{
int x = 3; 
int y = 5;
printf("%d\n", soma(x + y));
}
���7�����	
���7�����	
����	����	
��@
�
������	��
��
��������
	� ��
'
��	
$�����	
�
@
�
������	��
��
��������
	� ��
'
��	
$�����	
�
!����		������
��������
��
�
��%�
��$�
	��
�����-����!����		������
��������
��
�
��%�
��$�
	��
�����-����
��6	
!��7�����	
	%�
!�		���	
!���

��
�
��%�
��
6	
!��7�����	
	%�
!�		���	
!���

��
�
��%�
��
������
���
�
	
�
������
���
�
	
�
!�	��%�!�	��%���
��		����
��
���7�����	��		����
��
���7�����	��		����
��
���7�����	��		����
��
���7�����	
��6	
!��7�����	
������	
��

��
�
��%�
	�
���!�����
6	
!��7�����	
������	
��

��
�
��%�
	�
���!�����
����
$���5$��	
�����	
3������	
��
�������
�
��	��
/��	
����
$���5$��	
�����	
3������	
��
�������
�
��	��
/��	
��
	�/��4��
	�/��4
�� �*�	���
�
�	
���������	1�*�	���
�
�	
���������	1
�� ���
���
$����$����
�� ���
���
�����L���������L����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
varvar
����
����
����
����
����
����
����
����
��		����
��
���7�����	��		����
��
���7�����	
11
��		����
!��
11
��		����
!��
$����$����
��		����
��
���7�����	��		����
��
���7�����	
11
��		����
!��
11
��		����
!��
$����$����
��6	
$�����	
��	
$���5$��	
6	
$�����	
��	
$���5$��	
�*�����	
3�
��%�
�*�����	
3�
��%�
�,�������4
	%�
�,�������4
	%�
��!����	��!����	
!���
�	
$���5$��	
�������	
!���
�	
$���5$��	
�������	
��
�
��%�
�,��������
�
��%�
�,������
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
var_internavar_interna
�� �������%�
��
$����
��	
�������%�
��
$����
��	
$���5$��	
���5
$���5$��	
���5
������
�����������
�����
P
�
��%�
�,������P
�
��%�
�,������
?�
��6	
$�����	
��	
$���5$��	
�*�����	
�%�
	%�
!�		���	
!���
6	
$�����	
��	
$���5$��	
�*�����	
�%�
	%�
!�		���	
!���
�
�
��%�)
��	
	��
�	
	�
	
�
�
��%�)
��	
	��
�	
	�
	
��������	��������	��
��6�����
�������%�
��
$����
��	
$���5$��	
�*�����	�6�����
�������%�
��
$����
��	
$���5$��	
�*�����	�
��		����
��
���7�����	��		����
��
���7�����	
11
��		����
!��
11
��		����
!��
�����L���������L����
��		����
��
���7�����	��		����
��
���7�����	
11
��		����
!��
11
��		����
!��
�����L���������L����
��8	���	
�	
���������	18	���	
�	
���������	1
&& 99 ������
�
��������
��
$���5$��������
�
��������
��
$���5$��
** 99 ������
�
�����:��
��
�!�������������
�
�����:��
��
�!�������
?Q
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
var
��		����
��
���7�����	��		����
��
���7�����	
11
��		����
!��
11
��		����
!��
�����L���������L����
��		����
��
���7�����	��		����
��
���7�����	
11
��		����
!��
11
��		����
!��
�����L���������L����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
����
��8��
��	$�������
��
8��
��	$�������
��
!�		����
!��
$����!�		����
!��
$���� +
'
�)
	�

�
+
'
�)
	�

�
����
��
����	
������
�	�5
	����
!�		���)
��!���
�		�	
����
��
����	
������
�	�5
	����
!�		���)
��!���
�		�	
����	
����	
!���
���	
���

�
���!�
��
!����		������
!���
���	
���

�
���!�
��
!����		������
���	����5$�����	����5$����
��		����
��
���7�����	��		����
��
���7�����	��		����
��
���7�����	��		����
��
���7�����	
��I�����	
�L�

�
���!���������
���������
'
����
I�����	
�L�

�
���!���������
���������
'
����

	���	
����
!��7�����	
�
$�����	
��
�������
��

	���	
����
!��7�����	
�
$�����	
��
�������
��
�
����	��
����	�
��6
���!������
�����!����
�
����
��

�
$����
����
�
6
���!������
�����!����
�
����
��

�
$����
����
�
��		����
��
I�����	��		����
��
I�����	��		����
��
I�����	��		����
��
I�����	
��6
���!������
�����!����
�
����
��

�
$����
����
�
6
���!������
�����!����
�
����
��

�
$����
����
�
��������
��
��������
��
!�������
��������!�������
�������� ��
$�������
$�����
�� ��		�
�����)
�	
��		�
�����)
�	
$�����	
	%�
	��!��
!�		���	
!��
$�����	
	%�
	��!��
!�		���	
!��
�����L���������L����)
	��

	��

��
�����%�
�	!������)
	��

	��

��
�����%�
�	!������
<tipo> funcao(int vet[], ...) 
{
...
<tipo> funcao(int vet[], ...) 
{
...
��		����
��
I�����	��		����
��
I�����	
11
�*��!��11
�*��!��
��		����
��
I�����	��		����
��
I�����	
11
�*��!��11
�*��!��
?T�
...
}
...
}
?T
�� ��
!�		��

�
$����
����
!��7�����)
	�
���
���
��������
��
!�		��

�
$����
����
!��7�����)
	�
���
���
��������
������
��
�
��%�)
�	
������
��
�
��%�)
�	
���������	
�������%�
��
!�0!���
���������	
�������%�
��
!�0!���
$����
$����
�
�%�
��

��
�0!����
�%�
��

��
�0!���
�� ��
��������

�
$����
����
$����
��
�������)
�%�
+
�����
��
��������

�
$����
����
$����
��
�������)
�%�
+
�����

��
�0!��
��	��
$�����
��
�0!��
��	��
$�����
��		����
��
I�����	��		����
��
I�����	��		����
��
I�����	��		����
��
I�����	
�� �		��)
�
�		��)
�
$����
���������
!���
��	�!������$����
���������
!���
��	�!������)
	�
���
���
)
	�
���
���
���������
��
���!�
��
�
��%�����������
��
���!�
��
�
��%��
�� ��
!�		��

�
$����
����
!��7�����)
�%�
+
����		5���
��
!�		��

�
$����
����
!��7�����)
�%�
+
����		5���
��������
�
	�
�����,�
��
��������
�
	�
�����,�
��
��������%�
��
�
��%���������%�
��
�
��%���
�����+�)
+
��!�������
��� ���
'
�
�
$����
���

�
���+�)
+
��!�������
��� ���
'
�
�
$����
���

�
�����,�
'
�
��$�
	��
���	�������
!���
�
��%�
�
�����
�����,�
'
�
��$�
	��
���	�������
!���
�
��%�
�
�����
�
����!
���%�
��	
����	��
����!
���%�
��	
����	�
?T 
��		����
��
I�����	��		����
��
I�����	��		����
��
I�����	��		����
��
I�����	
��D
����
�
$����
+
�
��������	�����)
�
D
����
�
$����
+
�
��������	�����)
�
!�		� �������
��
�%�
���������
�����,�
��
!�		� �������
��
�%�
��������
�
�����,�
��
��������%�
��
�
��%�
	�
��	������
�!���	
P
��������%�
��
�
��%�
	�
��	������
�!���	
P
!�������
�����	%��!�������
�����	%��
void show_matriz(int mat[][10], int n_linhas) 
{
...
}
void show_matriz(int mat[][10], int n_linhas) 
{
...
}
?>
������
�������
'
�

�
!��7�����
��
�
��%�
�%�
��$�
	��
����
�������
'
�

�
!��7�����
��
�
��%�
�%�
��$�
	��
��������)
!�����������)
!���99	�

����-��
�
'
����������
	�

����-��
�
'
����������
constconst��
����

	�
�%�
��

	�
�%�
��� �
�
�������%�
��� �
�
�������%�
��
!��7��������
!��7������
���	����	����	����	�
??
�����+�)
	�
�*�	���
��
���!�
��
�
��%�

��
�������%�
��
���+�)
	�
�*�	���
��
���!�
��
�
��%�

��
�������%�
��

�
!��7�����
���������
����
���	�����)
�
���!������

�
!��7�����
���������
����
���	�����)
�
���!������
�����5

��
���	����
��
�����5

��
���	����
��
��$���L������$���L������
���7�����	
��
�
��%�
!�����!�����7�����	
��
�
��%�
!�����!��
11
11
argvargv)
)
argcargc
���7�����	
��
�
��%�
!�����!�����7�����	
��
�
��%�
!�����!��
11
11
argvargv)
)
argcargc
����������3;:����
��
���
�����	
���� ���	43;:����
��
���
�����	
���� ���	4
�� @

�
�:����
�������@

�
�:����
�������
�� ��		
�
$����
�����
�
��
��
�
�
3
�4��		
�
$����
�����
�
��
��
�
�
3
�4
�����$���$3#
����
�	
���
�����	
���� ���	43#
����
�	
���
�����	
���� ���	4�����$���$3#
����
�	
���
�����	
���� ���	43#
����
�	
���
�����	
���� ���	4
�� @

�
$����
��
!�������	
!���
	�����	@

�
$����
��
!�������	
!���
	�����	
�� 6
!�������
���
�����)
���$U�V)
+
	��!��
�
����
��
6
!�������
���
�����)
���$U�V)
+
	��!��
�
����
��
!�������!�������
int main(int argc, char **argv)int main(int argc, char **argv)
���7�����	
��
�
��%�
!�����!�����7�����	
��
�
��%�
!�����!��
11
11
argvargv)
)
argcargc
���7�����	
��
�
��%�
!�����!�����7�����	
��
�
��%�
!�����!��
11
11
argvargv)
)
argcargc
���*��!���
��
�*��
���1�*��!���
��
�*��
���1
./p66a arg1 arg2 arg3 arg4./p66a arg1 arg2 arg3 arg4
�
�
�
Q
T
! ? ? �
� � � �
� � � �
� � � Q
� � � T
���$
����
E
>
??�
��8�
� (���
+
����
���
�	�$�
	�
!���
	��
��������
8�
� (���
+
����
���
�	�$�
	�
!���
	��
��������
��
�����	
��
	�
!�0!������
�����	
��
	�
!�0!����
A����
��-��
���
���)
$��L
!����	�
��
�����
�
��

�
!�
��
��
���
����B
A����
��-��
���
���)
$��L
!����	�
��
�����
�
��

�
!�
��
��
���
����B
�
����	�
����	
11
S��
�	�$�����11
S��
�	�$�����
�
����	�
����	
11
S��
�	�$�����11
S��
�	�$�����
�
��

�
!�
��
��
���
����B�
��

�
!�
��
��
���
����B
A����
��������
���
�	�$�����)
$��L
!�������
���
��
��������
���
�	�$������B
A����
��������
���
�	�$�����)
$��L
!�������
���
��
��������
���
�	�$������B
�� �
���
�	%�
+

��
�����
������		����
��
��	��$��
�
���
�	%�
+

��
�����
������		����
��
��	��$��
!�� ����	)
!��	
�
��$���
��
!�� ����	
������	
��
!�� ����	)
!��	
�
��$���
��
!�� ����	
������	
��
��	��
���
��-���	��
���
��-���
��8�
!����		�
���
�	�$�
���	�	��
��
�
�	
!����	18�
!����		�
���
�	�$�
���	�	��
��
�
�	
!����	1
�
����	�
����	
11
S��
�	�$�����11
S��
�	�$�����
�
����	�
����	
11
S��
�	�$�����11
S��
�	�$�����
��8�
!����		�
���
�	�$�
���	�	��
��
�
�	
!����	18�
!����		�
���
�	�$�
���	�	��
��
�
�	
!����	1
�� 6
6
��	�
���$�����	�
���$���)
�
(�
	��
�%�
+
���,������)
�
(�
	��
�%�
+
���,������
�� 8�
8�
�+����
������+����
����� '
�
���
-
�
!�� ����
�

�
�
���	
'
�
���
-
�
!�� ����
�

�
�
���	
!�� ����	
������	
��
��	��
���
��-��!�� ����	
������	
��
��	��
���
��-��
���5��
��
��
��������1�5��
��
��
��������1
���3�4
E���3�4
E
�)�) 	�
�
E
�	�
�
E
�
�
W
���3��
W
���3�99�4)�4) 	�
�
X
�	�
�
X
�
�
����	�
����	
11
S��
�	�$�����
11
S��
�	�$�����
&& ����������������
�
����	�
����	
11
S��
�	�$�����
11
S��
�	�$�����
&& ����������������
�
W
���3��
W
���3�99�4)�4) 	�
�
X
�	�
�
X
�
int fat(int n)int fat(int n)
���
��%�
���
�	�$�
'
�
����
��
�
��������
��

�
�
��%�
���
�	�$�
'
�
����
��
�
��������
��

�
�:����1�:����1
�
����	�
����	
11
S��
�	�$�����
11
S��
�	�$�����
&& ����������������
�
����	�
����	
11
S��
�	�$�����
11
S��
�	�$�����
&& ����������������
int fat(int n)
{
if (n != 1)
return n * fat(n-1);
else
return 1;
}
int fat(int n)
{
if (n != 1)
return n * fat(n-1);
else
return 1;
}
>Y
�������	�����	 ���������	
	%�
���������	
	%�
���	
���������	
���	
���������	
'
����
'
����
�����	
��
�������
�����	
��
�������
���
�	�$����
�	�$���
������
��)
����
��)
'
����

	���
��������������'
����

	���
��������������)
�
)
�
���
�	�$�����
�����
�
���
�	�$�����
�����
�
���	
���
�
���
���0������	
���
�
���
���0���
�
����	�
����	
11
S��
�	�$�����
11
S��
�	�$�����
&& ��	$�������	��	$�������	
�
����	�
����	
11
S��
�	�$�����
11
S��
�	�$�����
&& ��	$�������	��	$�������	
���
�	�$�����
�����
�
���
�	�$�����
�����
�
���	
���
�
���
���0������	
���
�
���
���0���
�
	��
�������
	��
������
��8�
8�
!������
��
���0���
+
��	��$���!������
��
���0���
+
��	��$��� ����
$�-
����
$�-
'
�
�
���!
�����
��-
�,�����
�

��
�
��%��'
�
�
���!
�����
��-
�,�����
�

��
�
��%��
�����!���
�	
�
�	
��!����������	
��
	+���
��
���!���
�	
�
�	
��!����������	
��
	+���
��
�� ������)

��
�����-���
��
�����
�� ������)

��
�����-���
��
�����
�������$�
�������$�
�
�
�
���
��
�����
�
���
��
�����
���
�	�$����
�	�$���
�
����	�
����	
11
S��
�	�$�����
11
S��
�	�$�����
&& �+���
��
�� �������+���
��
�� ������
�
����	�
����	
11
S��
�	�$�����
11
S��
�	�$�����
&& �+���
��
�� �������+���
��
�� ������
�)�) 	�
�
E
�)
�	�
�
E
�)
�
>Y�
�3�4
E�3�4
E
�)�) 	�
�
E
�)
�	�
�
E
�)
�
�3��3�99�4
Z
�3��4
Z
�3�99�4)�4) 	�
�
X
�	�
�
X
�
�� �%�
����	
�%�
����	
�� ��	��	
��
��7�����
��	��	
��
��7�����
�)
�)
Q)
���)
��)
�)
Q)
���)
�)
��	!�	��	
)
��	!�	��	
!��
�����
�����	�����
��
!�������
!�	���
!��
�����
�����	�����
��
!�������
!�	���
�� ����������������99	�
����	�����
����	
�	
��	��	
!���
�
��������
	�
����	�����
����	
�	
��	��	
!���
�
��������
!�	��)

����-����
�
�����
�:����
��
��$������	)
��
!�	��)

����-����
�
�����
�:����
��
��$������	)
��
���
����
'
�
�	
	��
����	
��	������	
	�(��
	���	�����	1���
����
'
�
�	
	��
����	
��	������	
	�(��
	���	�����	1
�
����	�
����	
11
S��
�	�$�����
11
S��
�	�$�����
&& 2����
��
[��0�2����
��
[��0�
�
����	�
����	
11
S��
�	�$�����
11
S��
�	�$�����
&& 2����
��
[��0�2����
��
[��0�
���
����
'
�
�	
	��
����	
��	������	
	�(��
	���	�����	1���
����
'
�
�	
	��
����	
��	������	
	�(��
	���	�����	1
���� �!���	
�!���	

�
� ��	��
!���
	��
��	��
!���
	��
��$���
��
����
$�-��$���
��
����
$�-��
���� �!���	
�	
��	��	
��
�!���	
�	
��	��	
��
��!���!� !����
	��
��$���	�!����
	��
��$���	�
Q�Q� 8�
��	��
8�
��	��
�%�
!���
	��
��������
	� ��
�
���
������%�
!���
	��
��������
	� ��
�
���
�������
�
����	�
����	
11
S��
�	�$�����
11
S��
�	�$�����
&& 2����
��
[��0�2����
��
[��0�
�
����	�
����	
11
S��
�	�$�����
11
S��
�	�$�����
&& 2����
��
[��0�2����
��
[��0�
>Y 
\����	\����	\����	\����	
��\����	
	%�
���������	
'
�
�������
!��7�����	
\����	
	%�
���������	
'
�
�������
!��7�����	
3���
�����	4�3���
�����	4�
������	
��
���!����%�
��
!�������
�)
�
!�+����	
��
���!����%�
��
!�������
�)
�
!�+99������	
��
���!����%�
��
!�������
�)
�
!�+����	
��
���!����%�
��
!�������
�)
�
!�+99
!����		����
!����		����
	
 	���
�	
 	���
� �	
�����	
!��
	
�
�	
�����	
!��
	
�
�������%���������%��
���
	
 	���
��%�
	0
�%�
+
�����-���
������
��
�
	
 	���
��%�
	0
�%�
+
�����-���
������
��
	�����	�	�����	�
��\����	
!����
	��

����-���	
��
�
���
��
�
����	
\����	
!����
	��

����-���	
��
�
���
��
�
����	
	��!��	�	��!��	�
��;%�
,5
$��������%�
��
��!�
;%�
,5
$��������%�
��
��!�
��
����	
!���
�	
���
�����	
��
����	
!���
�	
���
�����	
��

��
�����)
!��	
�����	
	%�

����-���	
	��!��	�����
��

��
�����)
!��	
�����	
	%�

����-���	
	��!��	�����
\����	\����	\����	\����	
��

��
�����)
!��	
�����	
	%�

����-���	
	��!��	�����
��

��
�����)
!��	
�����	
	%�

����-���	
	��!��	�����
!���
!���
	
 	���
��%�
��
��*��	
 	���
��%�
��
��*����
��8��
�����
	��
���
�����	
+
!����		���
����

��
8��
�����
	��
���
�����	
+
!����		���
����

��
���	�����
	�� 0��������	�����
	�� 0�����
#define MAX 100
#define TITULO "maxi"
#define MOSTRA(x) "Valor(MAXIMO = %d): ", x
int main() {
int maxi; 
printf(TITULO);
printf(MOSTRA(MAX));
#define MAX 100
#define TITULO "maxi"
#define MOSTRA(x) "Valor (MAXIMO = %d): ", x
int main() {
int maxi; 
printf(TITULO);
printf(MOSTRA(MAX));
\����	\����	\����	\����	
printf(MOSTRA(MAX));
scanf("%d", &maxi);
printf("Valor lido de MAX = %d\n", maxi);
}
printf(MOSTRA(MAX));
scanf("%d", &maxi);
printf("Valor lido de MAX = %d\n", maxi);
}
int main() {
int maxi; 
printf("maxi");
printf("Valor (MAXIMO = %d): ", 100);
scanf("%d", &maxi);
printf("Valor lido de MAX = %d\n", maxi);
}
int main() {
int maxi; 
printf("maxi");
printf("Valor (MAXIMO = %d): ", 100);
scanf("%d", &maxi);
printf("Valor lido de MAX = %d\n", maxi);
}
// Constante numérica
#define MAX 100
// Constante numérica
#define MAX 100
\����	\����	\����	\����	
��;�
�*��!��
��������1;�
�*��!��
��������1
// Constante de caracteres
#define TITULO "maxi"
// Macro
#define MOSTRA(x) "Valor (MAXIMO = %d): ", x
// Constante de caracteres
#define TITULO "maxi"
// Macro
#define MOSTRA(x) "Valor (MAXIMO = %d): ", x
// Determina o maior entre dois números// Determina o maior entre dois números
��\��	
�*��!��	
��
�����	1\��	
�*��!��	
��
�����	1
\����	\����	\����	\����	
// Determina o maior entre dois números
#define MAX(x) ( ((x) > (y)) ? (x) : (y) )
// Determina o menor entre dois números
#define MIN(x) ( ((x) < (y)) ? (x) : (y) )
// Determina o maior entre dois números
#define MAX(x) ( ((x) > (y)) ? (x) : (y) )
// Determina o menor entre dois números
#define MIN(x) ( ((x) < (y)) ? (x) : (y) )
?Y
������
'
�
�����	
!��L���	�	.����
'
�
�����	
!��L���	�	.
�����������	
��
�����
���������	
��
�����
��$��

����-��
!��L���	�	��$��

����-��
!��L���	�	
!���
��������
'
�
�
�������%�
�	��(�
�������
!���
��������
'
�
�
�������%�
�	��(�
�������
\����	\����	\����	\����	
!���
��������
'
�
�
�������%�
�	��(�
�������
!���
��������
'
�
�
�������%�
�	��(�
�������
��	��
	�
�	
!��7�����	
�����
	
 	���
/��	
!��
��	��
	�
�	
!��7�����	
�����
	
 	���
/��	
!��
�*!��		��	��*!��		��	�
?C
��;%�
����
��
!����;%�
����
��
!����99��99$/��
��
��
�������%�
��
$/��
��
��
�������%�
��
���	�����	
�
�����	1���	�����	
�
�����	1
#define SOMA (x,y) ((x) + (y));
printf(“Resultado: %d”, SOMA(3,5));
#define SOMA (x,y) ((x) + (y));
printf(“Resultado: %d”, SOMA(3,5));
\����	\����	\����	\����	
���!0	
�
!�+�!0	
�
!�+99!����		������1!����		������1
printf(“Resultado: %d”, SOMA(3,5));printf(“Resultado: %d”, SOMA(3,5));
printf(“Resultado: %d”, ((3) + (5)););printf(“Resultado: %d”, ((3) + (5)););
��;%�
���*��
�	!���
�����
�
����
��
�����
�
�	
;%�
���*��
�	!���
�����
�
����
��
�����
�
�	
��	��
��
���
�����	1��	��
��
���
�����	1
#define SOMA (x,y) ((x) + (y))#define SOMA (x,y) ((x) + (y))
\����	\����	\����	\����	
���
�������%�
�����
	��5
�����!������
����

��
�
�������%�
�����
	��5
�����!������
����

��
���	�����
�
(�
$����
+1���	�����
�
(�
$����
+1
(x,y) ((x) + (y))(x,y) ((x) + (y))
��\����	
\����	
�%�
	%�
���
�	�$�	�%�
	%�
���
�	�$�	��
��\����	
!����
	��

����-���	
!���
	
 	���
��
\����	
!����
	��

����-���	
!���
	
 	���
��
����	
��
�
����	
���,�����	)
�!�	��
��
����	
��
�
����	
���,�����	)
�!�	��
��
�%�
�%�
\����	\����	\����	\����	
����	
��
�
����	
���,�����	)
�!�	��
��
����	
��
�
����	
���,�����	)
�!�	��
��
�%�
�%�
	��
�����������	��
�������������
?H
D
�	���	D
�	���	D
�	���	D
�	���

Outros materiais