Posts

Showing posts with the label php program

Find number of days in a month in C | Cpp | Java | Go | php

C Program #include<stdio.h> int main() { int m,y; printf("Enter any month, say(1-12): "); scanf("%d",&m); switch(m) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: printf("31 days"); break; case 4: case 6: case 9: case 11: printf("30 days"); break; case 2: printf("Enter the year: "); scanf("%d",&y); if(y%400 == 0 || y%100 != 0 && y%4 == 0) { printf("29 days"); } else { printf("28 days"); } break; default: printf("Invalid input"); } } C++ Program #include<iostream> using namespace std; int main() { int m,y; cout << "Enter any month, say(1-12): "; cin >> m; switch(m) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: cout << "31 days"; break; case 4: case 6: case 9: case 11: cout << "30 day…

Popular posts from this blog

Overview of Go lang

Arrays in C Language

Program to calculate telephone bill

String in golang

Data Types in Go language

Installing go lang

Say Hello world in Go lang

Creating your first html page

Arrays in Go lang

Decision Making in Go lang