Posts

Showing posts from April, 2018

My Subject Blog

C Program Swapping using Bitwise Operator

/*  C Program doing Swapping using Bitwise Operator  */ #include <stdio.h> int main()  { int i=10,j=20; printf("\n Before Swapping : i =%d j=%d",i,j); i^=j^=i^=j; printf("\n After Swapping : i =%d j=%d",i,j); return 0; }

C Program Upper to Lower and Lower to Upper Case

/*  Write a C Program to Conver all Character of String from upper to lower and lower to upper case.  */ #include <stdio.h> int main(void)  { char str[20]="aBcDeF"; int i=0; while(str[i]!='\0') { str[i]=str[i]^32;                 //Above Logic will convert character upper to Lower and lower to upper i++; } printf("Changed String : %s",str); return 0; }

Followers