Answer to Question #262780 in C++ for Urooj

Question #262780

Write a program to find the number and sum of all integers between 100 and 200 which are divisible by 9. Only a single for loop is required for this exercise.


1
Expert's answer
2021-11-08T05:32:49-0500
using namespace std;




//	Write a program to find the number and sum of all integers between 100 and 200 which are divisible by 9. 
//	Only a single for loop is required for this exercise.


int main()
{
	int n,Sum=0;
	cout<<"\n\tNumbers are : ";
	for(n=100;n<=200;n++)
	{
		if(n%9==0) 
		{
			cout<<n<<", ";
			Sum = Sum + n;	
		}
	}
	cout<<"\n\tAnd the Sum = "<<Sum;
	return(0);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS