Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- int num = 1, par = 0, impar = 0, maior = 0, menor = 0, primo = 0;
- int x=0, i=0, cont=0;
- do {
- if (num!=0){
- printf("Entre com o numero: %i\n", i+1);
- printf("-> ");
- scanf("%d", &num);
- }
- i++;
- if (i==0)
- maior = num;
- if (num>maior)
- maior = num;
- if (num<menor)
- menor = num;
- if (num!=0){
- if (num%2==0)
- par++;
- else
- impar++;
- }
- /* while (x<=num){
- if(num%x==0)
- cont++;
- x++;
- }
- if (cont==2)
- primo++; */
- } while (num!=0);
- printf("\n");
- printf("Pares: %d\n", par);
- printf("Impares: %d\n", impar);
- printf("Maior: %d\n", maior);
- printf("Menor: %d\n", menor);
- /* printf("Primos: %d\n", primo); */
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement