A Place for Latest Exam wise Questions, Videos, Previous Year Papers, Study Stuff for MCA Examinations - NIMCET
Previous Year Question (PYQs)
1
What will be output of following statements?
char ch;
ch = 130;
printf("\nvalue of ch=%d", ch);
Solution
Solution:
In C, the range of `char` is from $-128$ to $127$.
When we assign $130$ to a `char`, it overflows:
$130 - 256 = -126$
Thus the value stored in `ch` is $-126$.
Output:
value of ch = -126
Online Test Series, Information About Examination, Syllabus, Notification and More.