Program to implement Single Pointer - TechnoHindi.Org

Latest

Saturday, August 8, 2020

Program to implement Single Pointer













#include <stdio.h> 
#include <conio.h> 
void main() 
int i=5, *x; 
float j=2.5, *y; 
char k='h', *z; 

x= &i; 
y= &j; 
z= &k; 

printf ("Value of i = %d", i); 
printf ("\nValue of j = %f", j); 
printf ("\nValue of k = %c", k); 

printf ("\nValue of i using x = %d", *x); 
printf ("\nValue of j using y = %f", *y); 
printf ("\nValue of k using z = %c", *z); 

printf ("\nAddress inside x = %u", x); 
printf ("\nAddress inside y = %u", y); 
printf ("\nAddress inside z = %u", z); 

x++; 
y++; 
z++; 

printf ("\nAddress inside x = %u", x); 
printf ("\nAddress inside y = %u", y); 
printf ("\nAddress inside z = %u", z); 

getch(); 
}
  1. Output :-

No comments:

Post a Comment