Enter all Sunday of instance codes for a month using the do... while method

  • 2021-07-04 18:02:53
  • OfStack

Enter all Sundays in a month using the do... while method (example code)


do{
  var date = Number(prompt(' Please enter 1 Total number of days in months '));
  var start = (prompt(' Please enter 1 Months 1 What day of the week is the number '));
  for(var i=0;i<date;i++){
    if((start+1)%7===0){
  console.log(i+' The number is Sunday ')
  }
}
  console.log(' Enquiry completed ');

}while('yes'===prompt(' Do you continue to inquire about rest days? ','yes Continue   Otherwise it ends '));
console.log(' End of query ');

Related articles: