Monday, 7 January 2013

Given an age guess out if someone is a baby, toddler, child, teenager, adult or an old codger. Assume limits by your own self.



#include<stdio.h>

void main ()

{

  int a;

  printf("enter your age:");
  scanf("%d",&a);

  if(a<=3)

  {printf("you are a baby");

  }


  if(a<=7)

  {printf("you are a todler");

  }

  if(a<=12)

  {printf("you are a child");

  }

  if(a<=17)
 
  {printf("you are a teenager");

  }

  if(a>=18)
  {printf("you are an adult or old codger");

  }


}


 

No comments:

Post a Comment