Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An integer is divisible by 3 and 9 if and only if the sum of its digits is divisible by 3 and 9. For example,

An integer is divisible by 3 and 9 if and only if the sum of its digits is divisible by 3 and 9. For example, suppose n = 27193257. Then s = 2 + 7 + 1 + 9 + 3 + 2 + 5 + 7 = 36. Because 36 is divisible by both 3 and 9, it follows that 27193257 is divisible by both 3 and 9. we write a C program that determines whether a positive integer is divisible by 3 and 9 by first finding the sum of its digits and then checking whether the sum is divisible by 3 and 9. [use do while loop only] Examples to test: Enter a positive integer: 27193257 The sum of the digits = 36 27193257 is divisible by 3 27193257 is divisible by 9 Enter a positive integer: 161905102 The sum of the digits = 25 161905102 is not divisible by 3 161905102 is not divisible by 9

Write in C language please...

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

39 Define an experiment wise error rate.

Answered: 1 week ago