tag:blogger.com,1999:blog-959939550345671470.post3073104174167778152..comments2024-03-17T12:50:37.677+05:30Comments on C programming Interview questions and answers: SWAP TWO VARIABLES WITHOUT USING THIRD USING C PROGRAM VARIABLEPriyanka kumarihttp://www.blogger.com/profile/08145649011863585828noreply@blogger.comBlogger35125tag:blogger.com,1999:blog-959939550345671470.post-32188219643971382812020-06-03T15:54:07.922+05:302020-06-03T15:54:07.922+05:30Good questions on c programming language. Will sha...Good questions on c programming language. Will share it on our <a href="https://www.tutlane.com/" rel="nofollow">programming</a> site.Suresh Dasarihttps://www.blogger.com/profile/01337689983379917267noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-91227591096940105592020-04-12T17:35:40.427+05:302020-04-12T17:35:40.427+05:30Nice article . There is good coding example collec...Nice article . There is good coding example collection visit <a href="https://www.javavogue.com/2015/11/top-50-core-java-coding-programming.html/" rel="nofollow"> <br /> Top coding program example</a><br />subham kumarhttps://www.blogger.com/profile/01727881826778414825noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-6246068357603516442016-11-27T01:35:49.690+05:302016-11-27T01:35:49.690+05:30plz help me
swap two numbers without using third ...plz help me<br /> swap two numbers without using third variableShayed Mollahhttps://www.blogger.com/profile/17055991864918903185noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-21667840110803493992016-11-27T01:34:09.952+05:302016-11-27T01:34:09.952+05:30plz help me
1 + X +( X2 / !2 )+ ( X3 / !3 ) + ( X4...plz help me<br />1 + X +( X2 / !2 )+ ( X3 / !3 ) + ( X4 / !4 ) Shayed Mollahhttps://www.blogger.com/profile/17055991864918903185noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-65777560030758475492015-11-28T18:51:02.518+05:302015-11-28T18:51:02.518+05:30How to swap 2 variable using only assignment opera...How to swap 2 variable using only assignment operator and no other operator in CAnonymoushttps://www.blogger.com/profile/05875561302054162680noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-51605520057460129932015-10-23T14:23:07.436+05:302015-10-23T14:23:07.436+05:30if do not use third variable then if do not use third variable then inderjeethttps://www.blogger.com/profile/06654141619943498716noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-39866546857842971292015-07-03T20:07:12.382+05:302015-07-03T20:07:12.382+05:30process 4 is not working. I things it's
b= b -...process 4 is not working. I things it's<br />b= b - ~a - 1;<br />a= a + ~b +1;<br />what u say?Anonymoushttps://www.blogger.com/profile/06730424848555219049noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-10942500642845669452015-07-03T19:59:32.764+05:302015-07-03T19:59:32.764+05:30This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/06730424848555219049noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-68864786096346315092014-09-15T02:32:53.139+05:302014-09-15T02:32:53.139+05:30void main()
{
int a,b;
clrscr();
printf("\n E...void main()<br />{<br />int a,b;<br />clrscr();<br />printf("\n Enter two no :");<br />scanf("%d%d",&a,&b);<br /><br />printf("\n Before Swaping value of a and b %d %d",a,b);<br /><br />b=a+b-(a=b);<br /><br />printf("\n After Swaping value of a and b %d %d",a,b);<br /><br />getch();<br />}Anonymoushttps://www.blogger.com/profile/12371736540145233620noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-13171055559292111082014-06-22T20:58:07.786+05:302014-06-22T20:58:07.786+05:30one more way
#include
#include
int main( )
{
sta...one more way<br />#include<br />#include<br /><br />int main( )<br /><br />{<br />static int a=2,b=5;<br /><br />a=a*b;<br /><br />b=a/b;<br />a=a/b;<br /><br /><br /><br />printf(" a =%d\t b=%d",a,b);<br />}Anonymoushttps://www.blogger.com/profile/12031522529797827047noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-88726980376520305242014-04-05T21:01:11.455+05:302014-04-05T21:01:11.455+05:30yupp...its correct order..(y)
yupp...its correct order..(y)<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-10590746633543100982014-02-25T23:08:24.693+05:302014-02-25T23:08:24.693+05:30Swapping of two numbers can be done in 5 methods u...Swapping of two numbers can be done in 5 methods u can see in following url...<br /><br />www.programmerschat.blogspot.in<br /><br />Abchttps://www.blogger.com/profile/16525837346957668121noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-35239395410487042032014-01-08T16:11:51.641+05:302014-01-08T16:11:51.641+05:30the right order is a=a+b,b=a-b,a=a-b
the right order is a=a+b,b=a-b,a=a-b<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-85486245734146035152013-10-19T21:24:39.001+05:302013-10-19T21:24:39.001+05:30@Ashok Natarajan this is also correct when given b...@Ashok Natarajan this is also correct when given both values some numbers.. if your give A=0,B=4 that time floating exception will happen..Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-43613642047712919222013-09-20T20:27:06.737+05:302013-09-20T20:27:06.737+05:30I have got another simple solution for this.
A=A*...I have got another simple solution for this. <br />A=A*B<br />B=A/B<br />A=A/B<br /><br />Swaping done.Ashok Natarajannoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-14007867249034206242013-08-02T01:02:07.940+05:302013-08-02T01:02:07.940+05:30Hi trinath your this program do my help & made...Hi trinath your this program do my help & made my image in class is a intelligenc boy so thenku very much Girish Patelhttps://www.blogger.com/profile/00813286434359294813noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-12927024719100077982013-05-19T21:25:16.080+05:302013-05-19T21:25:16.080+05:30First take 2's complement of -3 which will be ...First take 2's complement of -3 which will be as:<br />3 <br />= 0000 0011 // binary value of 3<br />= 1111 1100 // take 1's complement i.e invert 0's & 1's<br />2's complement = 1111 1101 // add 1<br /><br />We have got result for -3. Now operation for ~ (1's complement is pending). We know in 1's complement 0's will replaced by 1's & 1's will be Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-10952073792560662642013-05-14T18:04:49.409+05:302013-05-14T18:04:49.409+05:30Process 1 & 5 are approx same.Process 1 & 5 are approx same.Anonymoushttps://www.blogger.com/profile/02225230810520598760noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-83488772773536911962013-04-17T13:29:19.721+05:302013-04-17T13:29:19.721+05:30HI can u please help me to solve the following
Swa...HI can u please help me to solve the following<br />Swap the values in 2 variBles using a third variAble?? Plzzzzz rply its urgentAnonymoushttps://www.blogger.com/profile/15036555990019489298noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-4488746969061837482013-03-13T17:40:18.659+05:302013-03-13T17:40:18.659+05:30read the question first. we don't have to use ...read the question first. we don't have to use third variable.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-70687452775404345702013-03-13T17:38:42.691+05:302013-03-13T17:38:42.691+05:30a=a+b-(b=a)
now since value of a will be assigned ...a=a+b-(b=a)<br />now since value of a will be assigned to b<br />so equation will be<br />a=a+b-(a)<br />a=bAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-27212131859798528592013-03-13T17:35:33.257+05:302013-03-13T17:35:33.257+05:30u r most welcomeu r most welcomeAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-49052095288455514372013-03-13T17:30:24.482+05:302013-03-13T17:30:24.482+05:30thank u very much. this is the best solution witho...thank u very much. this is the best solution without using third variable. simple and shortAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-7754055783731595252013-03-13T17:28:53.114+05:302013-03-13T17:28:53.114+05:30a=a+b
a=a-b
b=a-ba=a+b<br />a=a-b<br />b=a-bAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-68696625868337765852013-03-02T20:03:38.629+05:302013-03-02T20:03:38.629+05:30learn c programming and c graphics from programmin...learn c programming and c graphics from <a href="www.programmingcampus.com" rel="nofollow">programmingcampus</a><br />where you can get best online tutorials which make simple and easy to your learning.Anonymousnoreply@blogger.com