Valid numbers in C Programming

Code: To find valid numbersImage result for c programming
  #include<stdio.h>
int main(){
  int n,count=0;;
  while(1){
  printf("Enter the number\n");
  scanf("%d",&n);
    if(n%8==0)
    {      count++;
    }else
    {
      printf("The number of valid numbers entered is %d",count);
      break;
    }
  }
  return 0;
}

No comments