main()
{
int i = 1;
int num[] = {1,2,3,4};
num[i] = i++;
printf("%d", num[i]);
}
what will be the output?
}
Answer Posted / tk
Answer is :: 3
Explanation::
main()
{
int i = 1;
int num[] = {1,2,3,4};
num[i] = i++; // Here i = 1, so num[1] = 1; and num =
{1,1,3,4}
// After the execution of this statement the value of i
will be 2 (as i++)
printf("%d", num[i]); // num[2] = 3 so answer is 3
}
}
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What are actual arguments?
What is the difference between array and structure in c?
In a header file whether functions are declared or defined?
What is a MAC Address?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
Describe the difference between = and == symbols in c programming?
What is the purpose of & in scanf?
how many errors in c explain deply
Explain void pointer?
What is strcmp in c?
What are 3 types of structures?
Create a simple code fragment that will swap the values of two variables num1 and num2.
Is it better to use a macro or a function?
What is 02d in c?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.