#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
	int gd=DETECT,gm,year,month,day,cy,cm,cd,i,j,maxx,maxy;
	int y,m,d;
	int midx, midy;
	int stangle = 0, endangle = 360;
	int xradius = 100, yradius = 50,xradius1 = 2, yradius1 = 2;
	int radius = 50;
	clrscr();
	initgraph(&gd,&gm,"d:\\tc\\bgi");
	maxx=getmaxx();
	maxy=getmaxy();
	for(i=0;i<10;i++)
	{
	setcolor(4);
		rectangle(i,i,maxx-i,maxy-i);
		rectangle(9,11+i,629,45-i);
	}
	for(i=0;i<315;i++)
	{
	delay(3);
	setcolor(2);
		rectangle(10+i,21,630-i,35);
		setcolor(i);
		outtextxy(280,24,"AGE CALCULATOR");
		setcolor(14);
		outtextxy(28,70,"*#### WELCOME ####*");
	}
	midx = getmaxx() / 2;
   midy = getmaxy() / 2;
   setcolor(getmaxcolor());

   /* draw ellipse */
   for(i=1;i<=100;i+=5)
   {
		delay(30);
		setcolor(2);
		ellipse(midx+i, midy+i, stangle, endangle,
		   xradius, yradius);
		setcolor(4);
		ellipse(midx-i, midy+i, stangle, endangle,
		   xradius, yradius);
		setcolor(6);
		ellipse(midx+i, midy-i, stangle, endangle,
		   xradius, yradius);
		setcolor(5);
		ellipse(midx-i, midy-i, stangle, endangle,
		   xradius, yradius);
   }


   for(i=5;i<=100;i+=3)
   {

		setcolor(15);
		circle(midx+i, midy-i, radius);
		setcolor(11);
		circle(midx+i, midy+i, radius);
		setcolor(3);
		circle(midx-i, midy-i, radius);
		setcolor(14);
		circle(midx-i, midy+i, radius);
		setcolor(12+i);
		//outtextxy(midx+200,midy,"PARITOSH");
		delay(20);
   }
   for(i=1;i<=100;i+=5)
   {
		delay(10);
		setcolor(15);
		ellipse(midx+i, midy, stangle, endangle,
		   xradius1+i, yradius1+i);
		setcolor(11);
		ellipse(midx, midy+i, stangle, endangle,
		   xradius1+i, yradius1+i);
		setcolor(3);
		ellipse(midx, midy-i, stangle, endangle,
		   xradius1+i, yradius1+i);
		setcolor(14);
		ellipse(midx-i, midy, stangle, endangle,
		   xradius1+i, yradius1+i);
		   //outtextxy(midx-20,midy,"WELCOME");
   }
   setcolor(14);
		   outtextxy(350,440,"* PRESS ANY KEY TO CONTINUE....");

	getch();
	closegraph();
	//gotoxy(300,200);
	//for(i=0;i<300;i++);
	//printf("%c",l);
 ll:	printf("\t\t\t\t\t :DATE  FORMAT:\n");
	printf("\t\t\t\t\tYYYY MM DD\n");

	printf("\n* ENTER THE CURRENT DATE:\t\t");
	scanf("%d%d%d",&cy,&cm,&cd);
	printf("\n* ENTER YOUR DATE OF BIRTH:\t\t");
	scanf("%d%d%d",&year,&month,&day);
	if(cm<=12 && month<=12 && cd<=31 && day<=31)
	{
		if(cd>=day)
			d=cd-day;
		else
		{
			d=(cd+30)-day;
			month=month+1;
		}
		if(cm>=month)
			m=cm-month;
		else
		{
			m=(cm+12)-month;
			year=year+1;
		}
		if(cy>=year)
			y=cy-year;
		else
		{
		mm:	printf("\nYOU HAVEN'T INPUT ACCURATELY !....\n");
			printf("PLEASE, INPUT AGAIN....\n\n");
			goto ll;
		}
		printf("\n* YOUR AGE ON THE CURRENT DATE:\t\t%d   %d  %d",y,m,d);
		printf("\n\n\n\n\n\n* PRESS ANY KEY TO EXIT....");
	}
	else
		goto mm;
	getch();
}

Recommended Answers

All 3 Replies

First your code is not formatted. Explain yourself. How does it failed?

#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()

I'm assuming those three headers provide all the undeclared identifiers in your code. Care to share with us where they come from?

main() returns int.

Care to share with us where they come from?

They are Turbo C headers (and/or non-standard ones). It was considered a nice compiler back in 1992.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.