Programming-for-Output-Problems
September 30, 2023Data-Structures
September 30, 2023Programming-for-Output-Problems
Question 18
|
The output of the following code is:
int main()
{
static int x[ ]={1,2,3,4,5,6,7,8}
int i;
for(i=2;i<6;++i)
x[x[i]]=x[i];
for(i=0;i<8;++i)
printf(“%d”,x[i]);
Return 0;
}
int main()
{
static int x[ ]={1,2,3,4,5,6,7,8}
int i;
for(i=2;i<6;++i)
x[x[i]]=x[i];
for(i=0;i<8;++i)
printf(“%d”,x[i]);
Return 0;
}
12244668
|
|
11335578
|
|
12335578
|
|
12343676
|
Question 18 Explanation:
![](https://solutionsadda.in/wp-content/uploads/2019/03/Screenshot_108.png)
![](https://solutionsadda.in/wp-content/uploads/2019/03/Screenshot_109.png)
Correct Answer: C
Question 18 Explanation:
![](https://solutionsadda.in/wp-content/uploads/2019/03/Screenshot_108.png)
![](https://solutionsadda.in/wp-content/uploads/2019/03/Screenshot_109.png)
Subscribe
Login
0 Comments