Advertisement
pranto_95

lab 4,task 1

Jun 3rd, 2015
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. /* input 10 numbers and check how many of those are odd*/
  2.  
  3. #include<stdio.h>
  4. int main(){
  5.     int a,n;
  6.     int c=0;
  7.     for (a=1;a<=10;a=a+1){
  8.             scanf("%d\n",&n);
  9.             if (n%2==1){
  10.                     c=c+1;
  11.             }
  12.     }
  13.     printf("Result is %d",c);
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement