I am unable to know where the segmentation fault is in the below code as a fault is detected by Hackerrank. I need to know where.
#include
#include
#include
#include
int main()
{
int m[10],i,min,max,k,n,p=1,sum=0,u[10],mins;
scanf("%d",&n);
scanf("%d",&k);
for(i=0;i max)
max=m[i];
}
if (min 0&&max>0)
mins=max>min?max:min;
else
{
if((min-max) 0)
{
u[i]=u[i]-(2*k);
goto x;
}
if(mins==m[i]&&mins<0)
{
u[i]=u[i]+(2*k);
goto x;
}
}
x:for(i=0;i
{
p=u[i]*m[i];
sum=sum+p;
}
printf("%d",sum);
return 0;
}
Answers
Answered by
1
Answer:
!!
Explanation:
please follow me.......
Similar questions