Null pointer: When referring to computer memory, a null pointer is a command used to direct a software program or operating system to an empty location in the computer memory. Commonly, the null pointer is used to denote the end of a memory search or processing event. In computer programming, a null pointer is a pointer that does not point to any object or function.
In the programming language c, NULL is an available command that can be used.
to find the amstrong number it is better to check a condition. following a pgrm:
#include<stdio.h> #include<conio.h>
void main() { int n,r,x,s=0; clrscr();
printf("enter the number:"); scanf("%d",&n);
x=n; while(n>0) { r=n%10; n=n/10; s=s+(r*r*r); }
if(x==s)
printf("%dis a amstrong number",s); else printf("%d is not a amstrong number",s); getch(); }
The NULL pointer points to a place in memory that cannot be accessed. NULL is useful when checking for error conditions and many functions return NULL if they fail.
pointer is a variable which contains the addresses of another variable. if at all we just declare the pointer variable but not define the value then the default value of that pointer is 'null'. it is called "null pointer"{.