PROGRAM TO INTERCHANGE THE VALUES OF C AND D

C, C++, etc Programing examples. Post as many you can. Test the programs and discuss about the output of the programes.
Forum rules
Please Discuss & post only about the programes and its Output

PROGRAM TO INTERCHANGE THE VALUES OF C AND D

Postby praveen » Sun Feb 22, 2009 7:21 pm

Code: Select all
/*PROGRAM TO INTERCHANGE THE VALUES OF C AND D*/

#include<stdio.h>
#include<conio.h>
main()
{
int c,d;
printf("Enter value for C\n");
scanf("%d",&c);
printf("Enter value for D\n");
scanf("%d",&d);
d=d-c;
c=c+d;
d=c-d;
printf("C=%d\n",c);
printf("D=%d\n",d);
getch();
}
Regards,
Praveen
AMIE Study

ImageImage
-------------------------------------------------------------------------------------------
Work from Home | AMIE Online Coaching
User avatar
praveen
Site Admin
 
Posts: 989
Joined: Thu Oct 23, 2008 1:42 pm
Location: Mumbai
membership: Senior Technician of The Institution of Engineers (India)- ST

ad
 

Re: PROGRAM TO INTERCHANGE THE VALUES OF C AND D

Postby vivakamble » Thu Dec 24, 2009 8:30 pm

dear praveen,
the name of ur program should be (program to interchange values of C & D without defining third variable) instead of to interchange values of C&D
"Don't expect things to happen
Struggle & make them happen"


Thanks & Regards,
VIVEK
User avatar
vivakamble
Super Member
Super Member
 
Posts: 33
Joined: Sun Sep 27, 2009 2:35 pm
Location: kolhapur
membership: Senior Technician of The Institution of Engineers (India)- ST

Re: PROGRAM TO INTERCHANGE THE VALUES OF C AND D

Postby praveen » Fri Dec 25, 2009 12:47 am

yes.. you are right.. just i noticed that.
Thanks for your information..
Regards,
Praveen
AMIE Study

ImageImage
-------------------------------------------------------------------------------------------
Work from Home | AMIE Online Coaching
User avatar
praveen
Site Admin
 
Posts: 989
Joined: Thu Oct 23, 2008 1:42 pm
Location: Mumbai
membership: Senior Technician of The Institution of Engineers (India)- ST


Return to Computer Notes : Some Sample Programs

Who is online

Users browsing this forum: No registered users and 0 guests