SHARE
TWEET

Untitled

a guest Feb 17th, 2020 91 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top