Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int i,M,N,sum=0;
- while(1)
- {
- scanf("%d %d",&M,&N);
- if(M<=0 || N<=0)
- {
- break;
- }
- else
- {
- for(i=N; i<=M; i++)
- {
- sum=sum+i;
- printf("%d ",i);
- }
- printf("Sum=%d\n",sum);
- sum=0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement