Thank you all for being with us.
Learn, Create and Implement.

  • Build Concept

    You can build your concept in programming on programsway.com.

  • Examples

    There are many C Programming examples on programsway.com.

  • Ask Questions

    Ask questions and get quick answers. Request any program and we will publish that program.

  • Thursday, 25 July 2013


    Posted by Kousik
    This is a program to calculate your age.
    /*AGE CALCULATE*/
    #include<stdio.h>
    int main()
    {
    int dd,dm,dy,cd,cm,cy,d,m,y;
    printf(“Enter your DATE OF BIRTH in dd mm yyyy format\n”);
    scanf(“%d %d %d”,&dd,&dm,&dy);
    printf(“Enter Current Date in dd mm yyyy format\n”);
    scanf(“%d %d %d”,&cd,&cm,&cy);
    y=cy-dy;
    if(dm>cm)
    {
    y--;
    m=12-(dm-cm);
    if(dd>cd)
    {
    m--;
    d=30-(dd-cd);
    }
    else
    {
    d=cd-dd;
    }
    }
    else
    {
    m=cm-dm;
    if(dd>cd)
    {
    m--;
    d=30-(dd-cd);
    }
    else
    {
    d=cd-dd;
    }
    printf(“You AGE is \n”);
    printf(“%d days %d months %d years\n”,d,m,y);
    }

    0 comments:

    Post a Comment