fork download
  1. #include <stdio.h>
  2. int main(void)
  3. {int a,b,c;
  4. char p,q;
  5. printf("enter the values of a,b,c:\n");
  6. scanf("%d%d%d",&a,&b,&c);
  7. a>b?((a>c)?printf("a is bigger"):printf("c is bigger")):((b>c)?printf("b is bigger"):printf("%d is bigger",c));
  8. /*swap two characters using bitwise operator*/
  9.  
  10. printf("\n enter p and q:");
  11. scanf(" %c %c",&p,&q);
  12. p=p^q;
  13. q=p^q;
  14. p=p^q;
  15.  
  16. printf("after swapping p =%c,q=%c",p,q);
  17. }
Success #stdin #stdout 0s 2160KB
stdin
1 2 3
a b
stdout
enter the values of a,b,c:
3 is bigger
 enter p and q:after swapping p =b,q=a