Skip to main content

SWAPPING OF VALUES C CODE


Q1:Write a C program to "interchange" values without using third                     variable?


 #include<conio.h>                     
 #include<stdio.h>                      
 void main()                                
 {                                                 
 clrscr();                                      
 //interchange number                
 int a=4;                                      
 int b=5;                                      
 clrscr();                                      
 printf("\na=%d",a);                     
 printf("\nb=%d",b);                     
 b=a+b;                                       
 a=b-a;                                        
 b=b-a;                                        
 printf("\nAfter interchanging ");  
 printf("\na=%d",a);                     
 printf("\nb=%d ",b);                    
 getch();                                      
 }                                                 

***********************************************************************************


Sample Output:








Comments

Popular posts from this blog

CAREER OPTIONS AFTER BCA

Career Options after BCA There are several doors opened, once you are done with your bachelor's in computer application(BCA).Apart from MCA or MBA in IT , one can also go for :  Masters in Computer Management  Masters Degree in Information Management (MIM)  Master of Science in Information Technology (M.Sc IT)  G-CAT Master  Postgraduate Diploma in Computer Applications  Post Graduate Program in Corporate Studies (PGPCS)  Postgraduate Diploma in Management (PGDM)  Program in Information Security Management  If one wants to get recruited and desires to be the part of corporate sector....there are numerous options for that too. One can work as a software developer, web developer, graphic Designer, App Developer for

ABOUT US

--------------- About Us ---------------- The Blog offers information and notes on the class subjects, instructed by the teacher and written by me. I have made this blog for the students who are for any reason are unable to attend the class. This will be an easy platform for them to get their class work and do it at anytime, anywhere and at their pace.   In this era of technology with just an internet connection, you can do anything and rely on this platform for your class work. Contacts Us: Facebook ID:  bcahubsd Email-  bcahubsd@gmail.com editor@bcahubsd.com

IMPORTANT QUESTIONS UNIX

UNIX OPERATING SYSTEM  Q1). Define Operating System. Discuss its various features.  Q2). Explain the various types of Operating System.  Q3). Differentiate between Unix and Windows OS.   Q4). Short notes on Different / Various OS.   Q5). Write a short note on: Kernel Shell Unix file system PCB Q6). Define Process. Explain its state with the help of a diagram. Q7). Explain commands File management Process management Inter user-Inter machine commands Q8). Explain input/output redirection with the help of  examples. Q9). Explain piping with the help of an example. Q10). Explain following commands:- chmod umask chusr adduser / addgroup group + define regular expressions ls who runlevels online help Q11). Define system administrator. Explain its role. Q12).Explain the steps of adding users and group in the UNIX  system. Q13). Define following terms:- Fdisk mount/unmount ...