Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- main()
- {
- int N, somma = 0, n,cont = 1;
- printf("Quanti numeri analizziamo? : ");
- scanf("%d", &n);
- n = n + 1;
- if(n<100)
- {
- while(cont<n){
- printf("Inserisci il %do numero: ", cont);
- scanf("%d", &N);
- if(N % 2 == 1){
- somma = somma + N;
- }
- printf("la somma temporanea : %d\n", somma);
- cont++;
- }
- }
- printf("La somma finale : %d ", somma);
- system("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement