C++ Program to Check Leap Year

Here is C++ program to check whether a year is a leap year or not. A leap year consists of 366 days instead of 365 days. In a leap year, February month consists of 29 days. #include<iostream> using namespace std; int main() { int year; cout<<“Enter Year(ex:1900):”; cin>>year; if(year%100==0) { if(year%400==0) cout<<“\nLeap Year”; } else

C++ Program to Check Leap Year Read More »

C++ Program to Print an Alphabet from A to L of *’s in Capital Letter

#include<iostream> using namespace std; int main() { int i,j,k=1; char ch; cout<<“Input an Alphabet in capital letters that you want to print:”; cin>>ch; cout<<“nnnn”; switch(ch) { case ‘A’: cout<<“ttt    “; for(i=1;i<=40;++i) { for(j=0;j<=22;++j) { if(i==1||i==2||i==21||i==20) cout<<“*”; else { if(j==0||j==20) cout<<“**”; else cout<<” “; } } cout<<“nttt    “; } break; case ‘B’: cout<<“tttt”; while(k<=2) { for(i=1;i<=9;++i)

C++ Program to Print an Alphabet from A to L of *’s in Capital Letter Read More »