#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); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter