Created
February 24, 2017 20:27
-
-
Save FelipeGrijo/24dc43b8d60fb87351cbca172fbe76c5 to your computer and use it in GitHub Desktop.
10) Entrar com um número e informar se ele é divisível por 10, ou é divisível por 5, ou é divisível por 2 ou se não é divisível por nenhum destes.
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
//https://gist.github.com/FelipeGrijo | |
#include <stdio.h> | |
int main() | |
{ | |
int Num=0; | |
printf("Exercicio 10\nDigite um numero:"); | |
scanf("%d",&Num); | |
if(Num % 10 == 0){ | |
printf("%d e divisivel por 10.\n",Num); | |
} | |
else if(Num % 5 == 0){ | |
printf("%d e divisivel por 5.\n",Num); | |
} | |
else if(Num % 2 == 0){ | |
printf("%d e divisivel por 2.\n",Num); | |
} | |
else | |
{ | |
printf("%d nao e divisivel por 10, 5 ou 2.\n",Num); | |
} | |
system("pause"); | |
return 0; | |
} |
LINDO meu parceiro dps da etec fez oq?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Em PHP seguindo a linguagem HTML.
<title>exercicio2</title> Primeiro Numero:// parte do 10 // if( !empty($op) ) { if($op == 's')
if($a % 10 == 0){
echo " é divisivel por 10" ;
}
else { echo " não é divisivel por 10 "; }
if($a % 5 == 0){
echo " é divisivel por 5" ;
}
else { echo " não é divisivel por 5 "; }
if($a % 2 == 0){
echo " é divisivel por 2" ;
}
else { echo " não é divisivel por 2 "; }
// programa escrito por Lázaro José - D.Sistemas-ETE 2018
?>