Answer:
Following are the code
#include <stdio.h>//header file
int main() // main function
{
int sum=0;// variable declaration
for(int i=1;i<=1000;i++) // iterating over the loop
{
if(i%10!=0 && i%5!=0) // check the condition & ignoring all numbers divisible by 10 and 5
sum=sum+i; // calculate sum
}
printf("%d",sum); // print sum
return 0;
}
Step-by-step explanation:
In this program we initialized an "sum " variable with "0" ,iterating over the loop and ignoring all numbers divisible by 10 and 5 and finally calculate sum.
output
400000