Introdução à Linguagem C - pucrs
Introdução à Linguagem C - pucrs
Introdução à Linguagem C - pucrs
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Operadores Aritméticos<br />
Exemplos<br />
Operação<br />
Adição<br />
Subtração<br />
Multiplicação<br />
Divisão<br />
Operador<br />
+<br />
-<br />
*<br />
/<br />
• 1+45<br />
• 45-38<br />
• 24*8<br />
• 12.5/3<br />
Profª. Leticia L. Leite - lleite@inf.<strong>pucrs</strong>.br<br />
Profª. Leticia L. Leite - lleite@inf.<strong>pucrs</strong>.br<br />
Operadores Aritméticos<br />
Exemplos<br />
Operação<br />
Resto da Divisão<br />
Inteira<br />
Potenciação<br />
Raiz Quadrada<br />
Absoluto<br />
Somente para<br />
Operador operadores<br />
inteiros<br />
%<br />
pow<br />
sqrt<br />
abs<br />
• 4%3 <strong>à</strong> 1<br />
• pow(4,2) <strong>à</strong> 16<br />
• sqrt (36) <strong>à</strong> 6<br />
• abs (-1234) <strong>à</strong> 1234<br />
Profª. Leticia L. Leite - lleite@inf.<strong>pucrs</strong>.br<br />
Profª. Leticia L. Leite - lleite@inf.<strong>pucrs</strong>.br<br />
Operadores Relacionais<br />
Operadores Relacionais<br />
Operação<br />
Operador<br />
Operação<br />
Operador<br />
Igual a<br />
==<br />
Menor ou igual<br />
<br />
Incremento<br />
++<br />
Maior ou igual<br />
>=<br />
Menor<br />
<<br />
Profª. Leticia L. Leite - lleite@inf.<strong>pucrs</strong>.br<br />
As instruções com operadores relacionais retornam<br />
0 para Falso e 1 para Verdadeiro.<br />
Profª. Leticia L. Leite - lleite@inf.<strong>pucrs</strong>.br