Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)
C Program To Print Number Of Days In A Month | Java Tutoring
Latest :

C Program To Print Number Of Days In A Month | Java Tutoring

C program to input the month number and print the number of days in that month – In this article, we will expand on how to input the month number and print the number of days in that month in C programming.

Suitable examples and sample programs have also been added so that you can understand the whole thing very clearly. The compiler has also been added with which you can execute it yourself.

The method used in this piece is the usual Standard Method.

It is pretty much known to the whole civilized humanity that a year is divided in 12 months. These 12 months constitute the whole of 365 days (366 in case of a leap year).

The months are as follows:

As we can see, there is a cluster of 12 months in a whole year with different days in one another. The months are named accordingly as per their order:

  1. January – 31 Days
  2. February – 28 Days
  3. March – 31 Days
  4. April – 30 Days
  5. May – 31 Days
  6. June – 30 Days
  7. July – 31 Days
  8. August – 31 Days
  9. September – 30 Days
  10. October – 31 Days
  11. November – 30 Days
  12. December – 31 Days

As it is evident, each month has a specific number denoted to it. So, by knowing the month number, we can know how many days are there in that month.

Thus, the way to do so in C programming is as follows:

Using Standard Method

1) Read the entered month number and store it in the variable n.

2) Check the month number using “if” condition, if month number is 1 or 3 or 5 or 7 or 8 or 10 or 12 then it prints no.of days in that month is 31.

3) If month number is 4 or 6 or 9 or 11 then it prints no.of days in that month is 20.

4) If month number is not matched with the above two if conditions then it prints no.of days is 29 or 28.

Output:

x

Check Also

C Program : To Find Maximum Element in A Row | C Programs

Write a C program to find the maximum element in each row of a given ...

atakoy escortatakoy escortbakırköy escorthalkali escortbağcılar escortsightcaredeneme bonusu veren siteleristanbul, escortromabetdeneme bonusu veren sitelerdeneme bonusu veren sitelerkulisbetDeneme Bonusu Veren Sitelercasino siteleriDeneme Bonusu Veren SitelerAlanya EscortDeneme Bonusu Veren SitelerpadişahbetgrandpashabetselçuksportsgrandpashabetgrandpashabetgrandpashabetGrandpashabetgrandpashabetgrandpashabetGrandpashabetsahabetbetnanodeneme bonusu veren sitelerdeneme bonusu veren sitelerSelçuksportsbetcioiptv satın almavibetextrabetiptvbetciomatbetcasibomMeritkingbetciokralbetsamsun escortcasibomcasibom girişcasibom girişcasibomcasibomjojobet girişTuz lambaZbahisZbahis GirişOtobetOtobet GirişBetcioBetcio Girişcasibom girişcasibomyalova escortBetturkeyBetturkey Girişmeritkingcasibombetwoonmeritkingescort antalyabahcesehir masaj salonucasibom güncel girişcasibomcasibom girişcasibomcasibom girişcasibom güncel girişjojobetmarsbahismarsbahis giriştimebettimebetgrandbettinggrandbetting giriştaraftarium24padişahbetgrandpashabetlidyabet girişcasibomMarsbahiskralbetcasibomGrandpashabetGrandpashabet girişGRANDPASHABETroyalbetcasinofastPalacebetramadabetgrandpashabetgrandpashabetcasibommeritkinggrandpashabettipicotr girişcasibom girişcasibomcasibombetexperextrabetslotbarslotbar girişbetparkbetpark girişpadişahbetpadişahbet giriştarafbettimebettipobetmeritking girişjojobet girişmatbet girişmegabahis girişextrabet,extrabet giriştempobet girişbetpark girişbetboo girişsafirbet girişmegabahisextrabettempobetbetparkbetboosafirbetrestbetsavoybettingmaksibetsekabetrestbet girişsavoybetting girişsekabet girişcasibom