Coding:
Code:
//Sorting
#include<stdio.h>
#include<conio.h>
void main()
{
int arr[5],i,t,count=0;
for(i=0;i<=4;i++)
{
printf("\n Enter element->");
scanf("%d",&arr[i]);
printf("%d",arr[i]);
}
for(i=0;i<=4;i++)
{
if(arr[i]<arr[i+1])
{
t=arr[i];
arr[i]=arr[i+1];
arr[i+1]=t;
}
count++;
}
printf("\n The no of changes are %d",count);
}
while running this program Surprisingly it is taking 5 inputs and hangs....saying something like "General Protection Exception" and "processor Fault"....
What should i do?is there anything wrong?Please help!!