Displaying date of birth

I am making a program that asks the user for their date of birth ,and then displays their approximate age using "2014-year=age" .the second part of code is working as it displays the age but the first part is not working can you please make it error free such that both parts interact each other.
that piece of code is follows

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>
#include <conio.h>
int main(void)
{
       int date;
       int month;
       int year;
       int cyear;
       int age;

	   printf("What is the date of birth:\n");
	   scanf("%d,%d,%d", &date &month &year);
	   
       
      
       
       
       cyear= 2014;
       age=cyear-year;
       
       printf("%d",age);
	   getch();
	   return 0;
}

please help soon.
Last edited on
You are missing commas in your first scanf().

Could you use [code] tags and indent your code? It would also be nice if you, in the future, actually mentioned what problems you were having.
Alright but the problem is still there first scanf is not taking input as 'date month year' and giving a unknown error with '&'sign.!!
What is the error?

And the code tags need to be lower case, and the / needs to appear before the word on the closing tag.
error1 C2296: '&' : illegal, left operand has type 'int *'
error2 IntelliSense: expression must have integral or unscoped enum type
these errrors appear in visual studio.
Fixed the bug ;;
the original code is now
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include<stdio.h>
#include<conio.h>
int main (void)
{
	int date;
	int month;
	int year;
	int cyear;
	int age;
	

	printf("please enter your date of birth:\n");
	scanf("%d,%d,%d",&date,&month,&year);

	   cyear= 2014;
       age=cyear-year;
       printf("Your age is :\n", age);
       printf("%d",age);
	   

	getch ();
	return 0;
}

thanks for consideration.
Topic archived. No new replies allowed.