Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int numI;
- int x;
- int cnt;
- char r;
- int main()
- {
- while(1)
- {
- //Input
- printf("\nIntroduza um Numero: ");
- fflush(stdin);
- scanf("%d", &numI);
- /////
- //Ciclo principal
- printf("\n");
- for(x=1;x<=numI;x++)
- if(x%3==0)
- {
- printf("%d\n", x);
- cnt++;
- }
- /////
- printf("\nQuantidade de Numeros Multiplos de 3 ate %d: %d\n\n", numI, cnt);
- //Repetição do ciclo
- printf("\nRepetir? y/n ");
- fflush(stdin);
- scanf("%c", &r);
- if(r=='y'||r=='Y')
- continue;
- if(r=='n'||r=='N')
- break;
- /////
- }
- printf("\n\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement