1. What will be the output of following code?
int arr[5]={22,2,78,12,4};
for(int i=0;i<5;i++)
{
for(int j=0;j<i;j++)
{
if(arr[i]>arr[j])
{
int temp;
temp= arr[i];
arr[i]=arr[j] ;
arr[j]=temp;
}
}
}
for(int i=0;i<5;i++)
cout<<arr[i]<<" ";