Skip to main content

PDF TEST

Write A C Program For Swapping Two Integers Using Pointer...

 

The code for this program is given below:



#include<stdio.h>

#include<conio.h>


void swap(int *x,int *y)

{

int temp;

temp=*x;

*x=*y;

*y=temp;

}


int main()

{

int a , b;

clrscr();

printf("Enter Value Of A:");

scanf("%d",&a);

printf("Enter Value Of B:");

scanf("%d",&b);

swap(&a,&b);

printf("After Swapping...");

printf("\nA=%d",a);

printf("\nB=%d",b);

getch();

return 0;

}

Output:



Comments

Popular posts from this blog

How to create PLAY & PAUSE(STOP) buttons in Macromedia Flash 8...

POST - 2 How to create PLAY & PAUSE(STOP) buttons in Macromedia Flash 8 Step-1 Open Macromedia Flash 8 and create New Flash Document. Step-2 Draw an Oval by clicking Oval in tools section. Step-3 Now in Layer-1 right click on Frame No. 60 and select Insert Keyframe. Step-4 Select(with selection tool in tools section) and drag Oval(Object) to your last position.(Where you want to end motion effect) Step-5 Now right click on Frame No. 30 and select Create Motion Tween. Step-6 Now add new layer(By right clicking on existing layer and choosing Insert Layer) and draw two buttons using rectangle tool in tools section.(Make sure to make both these buttons of different colours. You can select colour before drawing from tools section) Step-7 Now right click on button and select Convert to symbol...Give proper name to button and make sure to select Type as Button.(Do this for both buttons. Names must be different) Step-8 (Optional) You can add text on your buttons from tools section... Step-...