Home / MCQ Bank / Computer
Computer Pointer Difficulty: Medium

What will be the output of the following C code? #include <stdio.h> int main() { int a[4] = {1, 2, 3, 4}; void *p = &a[1]; void *ptr = &a[2]; int n = 1; n = ptr - p; printf("%d\n", n); }

Select the correct option to test your answer:

More Computer Questions

You want to create a standard access list that denies the subnet of the following host: 172.16.50.172/20. Which of the following would you start your list with? What will be the output of the following C code? #include <stdio.h> int main() { printf("examveda\r\nclass\n"); return 0; } How to specify autowiring by name? Which of the following function creates a CSS gradient image that can be used anywhere an image URL is required, including background-image, border-image, and list-style properties? What will be the output of the following C++ code? #include <iostream> #include <vector> using namespace std; int main () { vector<int> a (3, 0); vector<int> b (5, 0); b = a; a = vector<int>(); cout << "Size of a " << int(a.size()) << '\n'; cout << "Size of b " << int(b.size()) << '\n'; return 0; }