What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » C question.

C question.
Author: Message:
John Anderton
Elite Member
*****

Avatar

Posts: 3908
Reputation: 80
37 / Male / Flag
Joined: Nov 2004
Status: Away
RE: C question.
quote:
Originally posted by Ezra
Now i dont want you to tell me how to do this, just tell me if its possible and a tip maybe o.O
He wants the swapping function ;)

The answer is as follows
code:
#include <stdio.h>
#include <conio.h>

void main()
{
float a,b;
clrscr();

printf("Enter values of a and b: ");
scanf("%f %f",&a,&b);

printf("\n\nBefore swapping\n");
printf("a = %f \nb = %f",a,b);

swap(&a,&b);

printf("\n\nAfter swapping\n");
printf("a = %f \nb = %f",a,b);

getch();
}

void swap(float *x, float *y)
{
float temp = x;
x = y;
y = x;
}

[

KarunAB.com
]

[img]http://gamercards.exophase.com/459422.png[
/img]
09-21-2006 01:11 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
C question. - by .Roy on 09-21-2006 at 12:39 PM
RE: C question. - by Ezra on 09-21-2006 at 12:48 PM
RE: C question. - by .Roy on 09-21-2006 at 12:58 PM
RE: C question. - by Ezra on 09-21-2006 at 01:02 PM
RE: C question. - by John Anderton on 09-21-2006 at 01:11 PM
RE: C question. - by .Roy on 09-21-2006 at 01:24 PM
RE: C question. - by .Roy on 09-21-2006 at 01:25 PM
RE: C question. - by Eljay on 09-21-2006 at 01:33 PM
RE: C question. - by .Roy on 09-21-2006 at 01:46 PM
RE: C question. - by RaceProUK on 09-21-2006 at 02:23 PM
RE: C question. - by .Roy on 09-21-2006 at 03:53 PM
RE: C question. - by RaceProUK on 09-26-2006 at 11:29 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On