C Programming - Input / Output - Discussion

Discussion Forum : Input / Output - Find Output of Program (Q.No. 6)
6.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    printf("%c\n", ~('C'*-1));
    return 0;
}
A
B
C
D
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
32 comments Page 2 of 4.

Alok said:   9 years ago
@Vallabh is correct.

Rahul said:   9 years ago
Thank you all for such a wonderful help. It is very helpful.

Jayant said:   8 years ago
You are right @Vallabh.

Aminul said:   8 years ago
Yes, Right @Venkat.

Pallavi said:   8 years ago
Agree @Venkat.

Mayank said:   8 years ago
Very nice explanation @Vallabh.

Noureen said:   7 years ago
Very well explained, Thanks @Mohd Pv Vanimal.

Hariraj said:   2 decades ago
ASCII Value of 'C' is 67.

67*-1=-67

applying bitwise not(~) to -67 will result in 66, which is the ASCII value of 'B'.

Swati said:   1 decade ago
Vallabh is right.

Diya said:   1 decade ago
What does this * in 67*-1 mean?


Post your comments here:

Your comments will be displayed after verification.