TERBO SORT

#include<stdio.h>
int main(){

long int i,j,t,arr[1000000];
int k;
scanf("%ld",&t);
for(i=0;i<t;i++)
    scanf("%ld",&arr[i]);
for(i=0;i<(t-1);i++)
{
    k=0;
    for(j=0;j<(t-1-i);j++)
    {
        if(arr[j]>arr[j+1])
        {
            arr[j]=arr[j]+arr[j+1];
            arr[j+1]=arr[j]-arr[j+1];
            arr[j]=arr[j]-arr[j+1];
            k=1;
        }
    }
    if(k==0)
        break;
}
for(i=0;i<t;i++)
    printf("%ld\n",arr[i]);
return 0;

}
WHY IT IS GIVING TIME LIMIT EXEDED?

try using a faster algorithm. Learn about quicksort.

The sort you are using is bubblesort , Use quicksort or Mergesort to solve this problem.
QuickSort is faster than bubblesort.

The time limit for TSORT problem is too stringent for any other algorithm…You must use Counting sort as its complexity is O(n) and other comparison sort algorithms can have best time complexity of O(nlgn)…