Nhập vào tháng của một năm. Cho biết tháng thuộc quí mấy trong năm

PHOTO EMBED

Thu Aug 19 2021 14:22:09 GMT+0000 (Coordinated Universal Time)

Saved by @_Ryan_ #c

#include<stdio.h>

void main()
{
int month;
    printf("enter month: ");
    do
    {
       scanf("%d", &month);
       if(month <= 0 || month > 12)
       {
           printf("enter month from 1 to 12\n");
           printf("enter month: ");
       }
    }while(month <= 0 || month > 12);

  if(month == 1 || month == 2 || month == 3 )
  {
     printf("%d month is the 1st quarter", month);
  }
  else if(month == 4 || month == 5 || month == 6)
  {
     printf("%d month is the sendcon quarter", month);
  }
  else if(month == 7 || month == 8 || month == 9)
  {
     printf("%d month is the third quarter", month);
  }
  else
  {
     printf("%d month is the fourth quarter", month);
  }
}
content_copyCOPY