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 is cohesion in c?
What is echo in c programming?
What are global variables?
What tq means in chat?
What is the use of #include in c?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
What is the difference between array and pointer in c?
Write a code to determine the total number of stops an elevator would take to serve N number of people.
while initialization of array why we use a[][2] why not a[2][]...?
What language is lisp written in?
Differentiate fundamental data types and derived data types in C.
Explain the difference between structs and unions in c?
what is different between auto and local static? why should we use local static?
What is 2 d array in c?
How do I send escape sequences to control a terminal or other device?