Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int n=100,count=0,sum=0;
- do
- {
- if(n%7==0)
- {
- ++count;
- sum += n;
- }
- n++;
- } while(n!=200);
- printf("Sum is %d and number is %d \n",sum,count);
- return 0;
- }
- //Output
- //Sum is 2107 and number is 14
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement