Guest User

Untitled

a guest
Feb 17th, 2020
102
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int i,M,N,sum=0;
  5.  
  6. while(1)
  7. {
  8. scanf("%d %d",&M,&N);
  9. if(M<=0 || N<=0)
  10. {
  11. break;
  12. }
  13. else
  14. {
  15. for(i=N; i<=M; i++)
  16. {
  17. sum=sum+i;
  18. printf("%d ",i);
  19. }
  20. printf("Sum=%d\n",sum);
  21. sum=0;
  22. }
  23. }
  24. return 0;
  25. }
RAW Paste Data