ISRO | ISRO CS 2020 | Question 25

What is the output of the following ‘c’ code assuming it runs on a byte addressed little endian machine?

filter_none

edit
close

play_arrow

link
brightness_4
code

#include <stdio.h>
int main( )
 {
   int x; char *ptr;
   x = 622,100,101;
   printf(“%d”, (*(char *)&x) * (x % 3));
   return 0;
 

chevron_right


(A) 622
(B) 311
(C) 22
(D) 110


Answer: (D)

Explanation:

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.