Ashokkumar01cbe
Broken In
this is a program to add two numbers without using arithmetic operators. I found this program in the web ,but i am unable to understand ,please explain me
the 7th and 8th steps ie..how the p and sum values are assigned.
#include"stdio.h"
#include"conio.h"
void main()
{
int a,b,sum;
char *p;
clrscr();
printf("Enter 2 values : ");
scanf("%d%d",&a,&b);
p = (char *)a; //7th step
sum = (int)&p; //8th step
printf("\nSum : %d",sum);
getch();
}

the 7th and 8th steps ie..how the p and sum values are assigned.
#include"stdio.h"
#include"conio.h"
void main()
{
int a,b,sum;
char *p;
clrscr();
printf("Enter 2 values : ");
scanf("%d%d",&a,&b);
p = (char *)a; //7th step
sum = (int)&p; //8th step
printf("\nSum : %d",sum);
getch();
}