#include<stdio.h>
int main()
{
int a;
char c;
int *A=&a;
char *C=&c;
printf("Enter the value of a,c\n");
scanf("%d,%d",&a,&c);
printf ("Adress of a,c= %d,%d\n",A,C);
printf("value of a,c= %d %d\n",a,c);
return 0;
}
output is:
c:\Users\Avinash\Desktop>a.exe
Enter the value of a,c
12,40
Adress of a,c= 6356740,6356739
value of a,c= 0, 40
scanf("%d,%d",&a,&c);-->scanf("%d, %c",&a,&c);orchar c;-->int c;aandcvariables, so they could have any value when your program starts. A good coding standard is to initialize variables with a value when they are defined.