//Print sum of multiples of 7 from 1 to given input using do while
#include<stdio.h>
int main()
{
int i=1,j,sum=0;
printf("Enter the number : \n");
scanf("%d",&j);
do{
if(i%7==0)
sum=sum+i;
i++;
}while(i<=j);
printf("Sum of multiples of 7 from 1 to %d = %d",j,sum);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: