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 Lower Triangular Matrix or Not | C Programs

Write a C program to determine whether the given matrix is a lower triangular matrix ...

atakoy escortatakoy escortbakırköy escortşişli escortbağcılar escortsightcaredeneme bonusu veren sitelerromabetdeneme bonusu veren sitelerdeneme bonusu veren sitelerDeneme Bonusu Veren SitelerDeneme Bonusu Veren SitelerDeneme Bonusu Veren SitelerDeneme Bonusu Veren Siteleren güvenilir bahis sitelerideneme bonusu veren sitelergrandpashabetgrandpashabetGrandpashabetdeneme bonusu veren sitelerdeneme bonusu veren sitelergrandpashabetcasibom güncel girişdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelercasinofastbetwoonroyalbetdeneme bonusugrandpashabetdeneme bonusu veren sitelermarsbahis girişvaycasino girişmeritkingdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelerromabetistanbul escortgrandpashabetgrandpashabetgrandpashabetgrandpashabetartemisbetcasibomjojobetcasibom güncel girişcasibom güncelcasibom güncelcasibom güncel girişsetrabetgrandpashabet girişgrandpashabetgrandpashabet girişcasibomcasibom güncel girişcasibomcasibom girişcasibom güncel girişcasibomcasibom girişcasibom güncel girişgrandpashabetgrandpashabet girişgrandpashabetgrandpashabet girişbetgray güncel girişvdcasinograndpashabetgrandpashabetgrandpashabetgrandpashabetgrandpashabetMeritkingzbahiscasibom girişcasibom girişcasibom girişdeneme bonusubetcio girişbetkomdeneme bonusu veren sitelerHititbetjojobetDeneme Bonusu Veren Sitelerfivem modscasibompadişahbetjojobetjcknepadişahbetBetsatVdcasinokalebetsekabetHoliganbetzbahiszbahismadridbetotobetotobetkingroyalotobetmadridbetmarsbahis giriş토토사이트atlasbetmarsbahisnumber one model agencyportobettimebettimebetdizipalHititbet Girişpusulabet betparkbetparkcasibomcasibomcasibomkalebetbetpuancasibom girişzbahiscasibommatbet güncel girişjojobet girişpusulabet girişpusulabetgrandpashabet girişmeritking girişmeritking güncel girişmarsbahis giriş güncelgrandpashabet güncel girişonwinsahabetmatadorbetjojobetholiganbetonwinmarsbahisjojobetmatbettipobetmeritkingmarsbahisjojobetmeritkingonwinonwinonwinpusulabet pusulabetcasibomcasibom girişcasibom güncel girişcasibom güncelrestbet girişmarsbahisjojobetmaltcasinomatbettipobetmeritkingbetpuansahabet girişonwinholiganbetsahabetonwinkralbet girişkralbetvdcasinograndpashabet girişgrandpashabet girişgrandpashabetsahabetbets10bets10 girişbahiscommeritkingsahabet girişbahiscommatbetgrandpashabetmarsbahissahabetmatbet giriştipobet giriştipobet girişmeritking girişsahabet girişmeritkingCasibombetpuanmarsbahis girişbahiscombetpuancasinoper güncel girişcasibomholiganbetcasinoper girişcasinoperPusulabetcasibom girişmarsbahisromabettambetdinamobetvdcasinobetwooncasibombetofficejojobetgrandpashabetgrandpashabetgrandpashabetlunabetgrandpashabetmarsbahis