#include <stdio.h>
int main(){
int batchs=-1;
int totalNumber=0;
int n;
while(batchs<0){
printf("Enter batchs: ");
scanf("%d", &batchs);
}
while(batchs > 0){
n = batchs % 10;
batchs /= 10;
if (n % 2 == 0 && n != 0){
totalNumber += 1;
}
}
printf("The total number of advertisements that will be displayed from the batch: %d\n",totalNumber);
scanf("%d", &batchs);
return 0;
}
Comments
Leave a comment