scanf("%d%d", &n, &m); if(n>m) { t=n;n=m;m=t; } while (n <= m) { sum=sum+n; n++; } printf("sum=%d\n", sum); }