Wednesday, 10 December 2014

Programming Quiz-1

Q: Write a program in which print 0 if 1 is provided as input and print 1 if 0 is provided.
Condition apply :
(i.) you can't use predefined function(like logical not).
(ii.) You can't use if-else condition.

Please Do comments...

1 comment:

  1. scanf("%d", & a) ;
    switch(a)
    {
    case(0):
    printf("1");
    break;
    case(1):
    printf("0");
    break;
    }

    ReplyDelete