Find the output of the below program.

#include
#include
void fun(int m[], int size)
{
int i;
for(i=0; i< size; i++)
{
if(m[abs(m[i])] > 0)
    m[abs(m[i])] = -m[abs (m[i])];
else
   printf("%d ",abs(m[i]));
}
}
int main()
{
int m[] = {1, 3, 2, 2, 1};
int n= sizeof(m)/sizeof(m[0]);
fun(m,n);
return 0;
}

1
1, 3
2
1, 1
3
3, 2
4
2, 1

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation