
Logo source
Today, I have come with something new. I'll represent C Language. As I'm a student of CSE, I thought to share some code with you all guys! Hope it'll help others too.
I'll solve one C code problem.
for(i=0; i<10; i++)
{
value = a[i];
if(value<0)
{
for(j=i; (j>0&&a[j-1]>=0);j--)
a[j] = a[j-1];
a[j]=value;
}
}
for(i=0; i<10; i++)
printf("%4d",a[i]);
}
If you build and run this code, you'll get your desire output.
I used Codeblocks for this code as its simple and easy to use.Download this app and run this code and inform me about your experience.