Skip to main content

DAY COUNTER

WRITE A PROGRAM TO COUNT YOUR DATE MONTH YEAR IN CURRENT TIME



#include<stdio.h>
#include<conio.h>
void main()
{
int yy,mm,dd,y,m,d,day,month,year;
clrscr();
printf("enter actual date:(dd/mm/yyyy):");
scanf("%d%d%d",&dd,&mm,&yy);
printf("enter your date of birth:(dd/mm/yyyy);");
scanf("%d%d%d",&d,&m,&y);
if(dd<d)
{
day=(dd+30)-d;
mm=mm-1;
}
else
{
day=dd-d;
}
if(mm<m)
{
month=(mm+12)-m;
yy=yy-1;
}
else
{
month=mm-m;
}
year=yy-y;
printf("now you are:%d year%d month%d day:",year,month,day);
getch();
}

Comments

Post a Comment

Popular posts from this blog

Kaun Banega Crorepati in c language

                 Welcome to Kaun Banega Crorepati # include <stdio.h> # include <conio.h> #include <graphics.h> #include <stdlib.h> #include"line2.h" int i; char y; void end() { printf("\n You Entered y \n"); printf("\n The program is ending !\n"); printf("\n Thank you for playing\n"); printf("\n Press any key to exit\n"); getch();  } void play() { void q2(); void sound(); printf("\n Your first question is-\n"); printf("\n Which is the capital of Maharashtra?\n"); printf("\n 1) Delhi" "\t" " 2) Mumbai\n"); printf("\n 3) Ranchi" "\t" " 4) Goa \n"); scanf("%d",&i); clrscr(); jeevan(); if(i==2) { printf("\n You win Rs 1000\n"); printf("\n Pres Any key to continue\n"); getch(); printf("\n Do you want to exit? If yes then press y else press other key .\n");...
Android Login View with Video Download Full Source Code