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


Please Help Members By Posting Answers For Below Questions

What are actual arguments?

639


What is the difference between array and structure in c?

561


In a header file whether functions are declared or defined?

624


What is a MAC Address?

621


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

630






Describe the difference between = and == symbols in c programming?

767


What is the purpose of & in scanf?

586


how many errors in c explain deply

1622


Explain void pointer?

580


What is strcmp in c?

589


What are 3 types of structures?

584


Create a simple code fragment that will swap the values of two variables num1 and num2.

798


Is it better to use a macro or a function?

643


What is 02d in c?

622


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2296