Pointer

Null Pointer in C

In this tutorial you will learn about null pointer in C with examples. When we declare a pointer, by default it points to some random memory location. If you will access the pointer then it may give some undesired value or the program may crash. What is Null Pointer in C? A pointer pointing to …

Null Pointer in C Read More »

C/C++ Program to Read Infinite Numbers and Arrange Them in Ascending Order

In this program we are reading infinite numbers and then arranging them in ascending order. Here infinite means, the program should read numbers until a particular number is entered to terminate the reading process. In our case we are using -1 to stop the reading process. As we already don’t know how many numbers will …

C/C++ Program to Read Infinite Numbers and Arrange Them in Ascending Order Read More »

C program to swap two numbers using pointers

#include<stdio.h> #include<conio.h> void main() { int *a,*b,*temp; clrscr(); printf(“Enter two mumbers:”); scanf(“%d%d”,a,b); printf(“Before Swaping:na=%d b=%d”,*a,*b); temp=a; a=b; b=temp; printf(“nAfter Swaping:na=%d b=%d”,*a,*b); getch(); }