Computer Science, asked by sorabsanjeev1, 19 days ago

Write a program to find the number of intigers greater 100 and less 200 which are divisible by 8.

Answers

Answered by s1742gopi12944
0

Explanation:

#include<stdio.h> 

int main() 

int i; 

i=100; 

do 

i++; 

if(i%7==0) 

printf("%d\t",i); 

 

}while(i<200); 

 

return 0; 

Answered by dhairyasinha20
0

Answer:

The numbers which are divisible by 7 between 100 and 200 are 105,112,119,126,...,196

The given series is in A.P. Since, the difference between the consecutive terms is constant. i.e., 11−105=119−112=...=7

The first term a=105

The common difference d=7

The last term a

n

=196

⟹a+(n−1)d=196

⟹105+(n−1)7=196

⟹(n−1)7=91

⟹n−1=13

⟹n=14

Therefore the sum the terms is S

n

=

2

n

(a+a

n

)

⟹S

n

=

2

14

(105+196)

⟹S

n

=7(301)=2107

Therefore, the sum of all the numbers between 100 and 200 which are divisible by 7 is 2107

Similar questions