Untitled
#include <stdio.h> int main() { int m,n,sum; for (int i = 1; ; i++) { sum=0; scanf("%d",&m); scanf("%d",&n); if (m>n && m>0 && n>0) { for (int i = n; i <=m; i++) { printf("%d ",i); sum=sum+i; } printf("sum =%d\n",sum); } else if (n>m && m>0 && n>0) { for (int i = m; i <=n; i++) { printf("%d ",i); sum=sum+i; } printf("sum =%d\n",sum); } else if (m<=0 || n<=0) { return 0; } } }