Created
December 14, 2018 22:08
-
-
Save ivanelson/eeded86e9b6735bf02f68b906e0a51c0 to your computer and use it in GitHub Desktop.
Quadrado de um número em "C"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main () { | |
| /* declaracoes */ | |
| int num; /* variavel utilizada para leitura da sequencia */ | |
| int quad; | |
| /* programa */ | |
| printf("Digite uma sequencia terminada por zero\n"); | |
| scanf("%d", &num); | |
| while (num != 0) /* os simbolos '!=' significam diferente */ | |
| { | |
| quad = num * num ; | |
| printf ("O quadrado de %d = %d\n", num, quad); | |
| scanf("%d", &num); | |
| } | |
| /* fim do programa */ | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment