Sunday, 25 October 2015

Swaping Values of a and b : C Programs



#include <stdio.h>
#include<conio.h>
void main() 

  {    

  int a, b,temp;   

      a=5;     

      b=10; 

   printf("First Values Are %d %d",a,b);  

   temp = a;    /* Value of a is stored in variable temp */  

  a = b;       /* Value of b is stored in variable a */  

  b = temp;    /* Value of temp(which contains initial value of a) is stored in variable b*/  

  printf("\nAfter swapping, value are  %d %d",a,b);     

getch();


}

25 Oct 2015

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.