Advertisement
Igor2909

es21

Dec 27th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. main()
  5. {
  6.     int N, somma = 0, n,cont = 1;
  7.     printf("Quanti numeri analizziamo? : ");
  8.     scanf("%d", &n);
  9.     n = n + 1;
  10.     if(n<100)
  11.     {
  12.         while(cont<n){
  13.             printf("Inserisci il %do numero: ", cont);
  14.             scanf("%d", &N);
  15.             if(N % 2 == 1){
  16.                 somma = somma + N;
  17.                
  18.             }
  19.             printf("la somma temporanea : %d\n", somma);
  20.             cont++;
  21.         }
  22.     }
  23.     printf("La somma finale : %d ", somma);
  24.     system("PAUSE");
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement