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
#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;
}
error1 C2296: '&' : illegal, left operand has type 'int *'
error2 IntelliSense: expression must have integral or unscoped enum type
these errrors appear in visual studio.
#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;
}