What is the output of the following code?#include <stdio.h>int main() { int arr[] = {10, 20, 30, 40, 50}; int *ptr = arr; ptr += 3; printf("%d\n", *ptr); return 0;}
Question
What is the output of the following code?#include <stdio.h>int main() { int arr[] = {10, 20, 30, 40, 50}; int *ptr = arr; ptr += 3; printf("%d\n", *ptr); return 0;}
🧐 Not the exact question you are looking for?Go ask a question
Solution
The output of the code will be 40.
Here's the step by step explanation:
- An integer array
arr[]is declared
Similar Questions
What will be the output of the following code snippet?
What is the output of the following code in Python?
What will be the output of the following C code?
What is the output for the following code?Note: This question helps in clearing conceptual technical interviews for service-based companies.
What will be the output of the following C++ code?
1/4
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.