Wednesday 5 February 2014

accept two numbers and print its address along with the numbers

# include <stdio.h>
# include <conio.h>
int main( )
{
    printf("if u like please share blog\n");
 // Declaring variable a, b = two numbers
 int a, b;

 // Inputing two numbers
 printf("Enter first number : ");
 scanf("%d",&a);

 printf("Enter first number : ");
 scanf("%d",&b);

 // Printing address along with number
 printf("First number : %d, Address : %d\n",a, &a);
 printf("First number : %d, Address : %d\n",*(&a), &a);

 printf("Second number : %d, Address : %d\n",b, &b);
 printf("Second number : %d, Address : %d",*(&b), &b);

 getch();
 return 0;
}

No comments:

Post a Comment