Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Calculate Sum Of Numbers Are Dividable By 7 & 8 Between 100 And 2000 Using Java
WhatsApp
Senthilvelan Sambamoorthy
Aug 13
2016
1
k
0
0
ssvsumnat2.rar
// Sum of numbers are dividable by 7 & 8 between 100 and 2000
class
ssvsumnat2
{
public
static
void
main(String args[])
{
int
sum=
0
,count=
0
;
System.out.println(
"\n\n\tSum of numbers are divible by 7 & 8 between 100 and 2000"
);
System.out.println(
"\t========================================================="
);
for
(
int
i=
100
;i<=
2000
;i++)
{
if
( (i%
7
==
0
)&&(i%
8
==
0
) ){
sum = sum + i;count++;}
}
// end of for
System.out.println();
System.out.println(
"\n\n\tCOUNT = "
+ count);
System.out.println(
"\n\n\tSUM = "
+ sum);
}
// end of main function
}
// end of class
Java
Up Next
Calculate Sum Of Numbers Are Dividable By 7 & 8 Between 100 And 2000 Using Java