Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(int argc, char *argv[]) {
- int total=0, even_count=0, number;
- #ifdef __WIN32
- system("CLS");
- #else
- system("clear");
- #endif
- do {
- printf("Digita un numero (digita -1 per finire): ");
- scanf("%d",&number);
- if (!(number%2)) {
- even_count++;
- }
- total++;
- } while (number != -1);
- printf("\nNumeri inseriti: %d.\nI numeri pari sono %d.\n", total, even_count);
- #ifdef __WIN32
- system("PAUSE");
- #endif
- return 0;
- }
Add Comment
Please, Sign In to add comment