A

Admin • 828.03K Points
Coach

Q. What is the output of the following C program?

Code:
#include <stdio.h>

int main()
{
signed char c;
c= 235;
printf("%d
", c);
return 0;
}
  • (A) 235
  • (B) -235
  • (C) Depends on compiler
  • (D) None of the above
  • Correct Answer - Option(C)
  • Views: 12
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin
The value of a variable of type “signed char” will be a negative value. The output is as follows:

$gcc prog2.c
$ a.out
-128

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.