Technology Lesson
Showing posts with label
pointers
.
Show all posts
Showing posts with label
pointers
.
Show all posts
Thursday, February 12, 2015
C program to swap two numbers using pointers
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int *a,*b,*temp;
cout<<"Enter value of a and b:";
cin>>*a>>*b;
temp=a;
a=b;
b=temp;
cout<<"
After swaping
a="<<*a<<"
b="<<*b;
getch();
}
Read more »
Older Posts
Home
Subscribe to:
Posts (Atom)