Sunday, April 14, 2019

clock in C++

1.Code for Clock in C++ by ARS
#include<iostream>

#include<conio.h>
#include<cstring>
using namespace std;
int main()
{
int h,m,s,i,j,k;
char c[5],d[10],n[17];
while(1)
{
for(k=0;k<4;k++)
{
switch(k)
  {
  case 0:
  strcpy(n,"baisakha");
  break;
  }

for(j=0;j<7;j++)
{
switch(j)
{
case 0:
strcpy(d,"sunday");
break;
case 1:
strcpy(d,"monday");
break;
case 2:
strcpy(d,"tuesday");
break;
case 3:
strcpy(d,"wednesday");
break;
case 4:
strcpy(d,"thursday");
break;
case 5:
strcpy(d,"friday");
break;
case 6:
strcpy(d,"saturday");
break;
}

for(h=0;h<24;h++)
{
if(h>12)
{
strcpy(c,"AM");
}
else
{

strcpy(c,"PM");
}
for(m=0;m<60;m++)
{
for(s=0;s<60;s++)
{
system("cls");
cout<<"current time:"<<h<<":"<<m<<":"<<s<<":"<<c<<"  Day:"<<d<<"  month:"<<n<<endl<<"           designed or developed by -sotware engineer ananta raj stha";
for(i=0;i<169999999;i++)
{
i++;
i--;
}


}
}
}
}

}
}

getch();
return 0;



}


1 comment: