Home / MCQ Bank / Computer
Computer Structure And Union Difficulty: Medium

What will be the output of the following C code? #include <stdio.h> struct p { int x; char y; struct p *ptr; }; int main() { struct p p = {1, 2, &p}; printf("%d\n", p.ptr->x); return 0; }

Select the correct option to test your answer:

More Computer Questions

What will be the output of the following Java code? class exception_handling { public static void main(String args[]) { try { int a = args.length; int b = 10 / a; System.out.print(a); try { if (a == 1) a = a / a - a; if (a == 2) { int c = {1}; c[8] = 9; } } catch (ArrayIndexOutOfBoundException e) { System.out.println("TypeA"); } catch (ArithmeticException e) { System.out.println("TypeB"); } } } } Note : Execution command line : $ java exception_handling one What is the size of *ptr in a 32-bit machine (Assuming initialization as int *ptr = 10;)? . . . . . . . . is proprietary tool for predictive analytics. What is the function of CTRL+P in Microsoft Word? In Java, what does the "default" case in a "switch" statement do?