Hello friends, welcome to our new post today we will create a Happy Diwali Program with C++.
For this program you don't need to add any graphics library you can copy the below code to run this program.
SOURCE CODE
#include <iostream>
#include <windows.h>
#include<string>
// Happy Diwali Program
using namespace std;
int main()
{
string name;
cout<<"\n\n\t\t\t\tPlease Enter YOur Nick Name "<<endl<<endl;
cout<<"\t\t\t\tName : ";
getline(cin,name);
for (int i = 0; i < 10; i++)
{
switch (1)
{
case 1:
system("cls");
system("color 09");
cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<"\t\t\t\t * "<<endl;
cout<<"\t\t\t\t ***"<<endl;
cout<<"\t\t\t\t ***"<<"\t\t\t\t\t"<<name<<endl;
cout<<"\t\t\t\t *"<<"\t\t\t\t\t"<<"----------"<<endl;
cout<<"\t\t\t**********************"<<endl;
cout<<"\t\t\t ******************** "<<"\t\t\t\t"<<"HAPPY :)"<<endl;
cout<<"\t\t\t ****************** "<<"\t\t\t\t"<<"----------"<<endl;
cout<<"\t\t\t **************** "<<endl;
cout<<"\t\t\t ************** "<<"\t\t\t\t"<<"DIWALI :)"<<endl;
cout<<"\t\t\t "<<"\t\t\t\t"<<"----------"<<endl;
Sleep(500);
case 2:
system("cls");
system("color 0A");
cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<"\t\t\t\t * "<<endl;
cout<<"\t\t\t\t ***"<<endl;
cout<<"\t\t\t\t ***"<<"\t\t\t\t\t"<<name<<endl;
cout<<"\t\t\t\t *"<<"\t\t\t\t\t"<<"----------"<<endl;
cout<<"\t\t\t**********************"<<endl;
cout<<"\t\t\t ******************** "<<"\t\t\t\t"<<"HAPPY :)"<<endl;
cout<<"\t\t\t ****************** "<<"\t\t\t\t"<<"----------"<<endl;
cout<<"\t\t\t **************** "<<endl;
cout<<"\t\t\t ************** "<<"\t\t\t\t"<<"DIWALI :)"<<endl;
cout<<"\t\t\t "<<"\t\t\t\t"<<"----------"<<endl;
Sleep(500);
case 3:
system("cls");
system("color 0C");
cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<"\t\t\t\t * "<<endl;
cout<<"\t\t\t\t ***"<<endl;
cout<<"\t\t\t\t ***"<<"\t\t\t\t\t"<<name<<endl;
cout<<"\t\t\t\t *"<<"\t\t\t\t\t"<<"----------"<<endl;
cout<<"\t\t\t**********************"<<endl;
cout<<"\t\t\t ******************** "<<"\t\t\t\t"<<"HAPPY :)"<<endl;
cout<<"\t\t\t ****************** "<<"\t\t\t\t"<<"----------"<<endl;
cout<<"\t\t\t **************** "<<endl;
cout<<"\t\t\t ************** "<<"\t\t\t\t"<<"DIWALI :)"<<endl;
cout<<"\t\t\t "<<"\t\t\t\t"<<"----------"<<endl;
Sleep(500);
case 4:
system("cls");
system("color 0D");
cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<"\t\t\t\t * "<<endl;
cout<<"\t\t\t\t ***"<<endl;
cout<<"\t\t\t\t ***"<<"\t\t\t\t\t"<<name<<endl;
cout<<"\t\t\t\t *"<<"\t\t\t\t\t"<<"----------"<<endl;
cout<<"\t\t\t**********************"<<endl;
cout<<"\t\t\t ******************** "<<"\t\t\t\t"<<"HAPPY :)"<<endl;
cout<<"\t\t\t ****************** "<<"\t\t\t\t"<<"----------"<<endl;
cout<<"\t\t\t **************** "<<endl;
cout<<"\t\t\t ************** "<<"\t\t\t\t"<<"DIWALI :)"<<endl;
cout<<"\t\t\t "<<"\t\t\t\t"<<"----------"<<endl;
Sleep(500);
case 5:
system("cls");
system("color 0E");
cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<"\t\t\t\t * "<<endl;
cout<<"\t\t\t\t ***"<<endl;
cout<<"\t\t\t\t ***"<<"\t\t\t\t\t"<<name<<endl;
cout<<"\t\t\t\t *"<<"\t\t\t\t\t"<<"----------"<<endl;
cout<<"\t\t\t**********************"<<endl;
cout<<"\t\t\t ******************** "<<"\t\t\t\t"<<"HAPPY :)"<<endl;
cout<<"\t\t\t ****************** "<<"\t\t\t\t"<<"----------"<<endl;
cout<<"\t\t\t **************** "<<endl;
cout<<"\t\t\t ************** "<<"\t\t\t\t"<<"DIWALI :)"<<endl;
cout<<"\t\t\t "<<"\t\t\t\t"<<"----------"<<endl;
Sleep(500);
case 6:
system("cls");
system("color 0F");
cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<"\t\t\t\t * "<<endl;
cout<<"\t\t\t\t ***"<<endl;
cout<<"\t\t\t\t ***"<<"\t\t\t\t\t"<<name<<endl;
cout<<"\t\t\t\t *"<<"\t\t\t\t\t"<<"----------"<<endl;
cout<<"\t\t\t**********************"<<endl;
cout<<"\t\t\t ******************** "<<"\t\t\t\t"<<"HAPPY :)"<<endl;
cout<<"\t\t\t ****************** "<<"\t\t\t\t"<<"----------"<<endl;
cout<<"\t\t\t **************** "<<endl;
cout<<"\t\t\t ************** "<<"\t\t\t\t"<<"DIWALI :)"<<endl;
cout<<"\t\t\t "<<"\t\t\t\t"<<"----------"<<endl;
Sleep(500);
}
}
system("pause");
return 0;
}
#include ????
ReplyDeletei think you should put this library as well.
Post a Comment