Advertisement
golovanovd

lab_nerush

Feb 8th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     int a, N, sum;
  6.     printf("Please, enter number of values:");
  7.     scanf("%i", &N );
  8.     for(i=1;i<=N;i++){
  9.         printf("\nPlease, enter value:");
  10.         scanf("%i", &a);
  11.         if(a%2!=0) sum++;
  12.         }
  13.     printf("\nNumber of odd values - %i", sum);
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement