![]() |
Write a program in C to Determine the following information about a positive integer
Determine the following information about a positive integer that is passed into a function:
(a) is the value a multiple of 7, 11, or 13 (a single yes or no) (b) is the sum of the digits of the value even or odd (c) is the value a prime number Help me Please!!!! |
Re: Write a program in C to Determine the following information about a positive inte
How far have you got and where are you stuck? Do you understand the requirements?
|
Re: Write a program in C to Determine the following information about a positive inte
for (a) and (b) you can easily use the modulo operator
e.g. to test whether it is a multiple of 7: (x%7)==0 e.g. to test even/odd: (x%2) Pieter |
Re: Write a program in C to Determine the following information about a positive inte
Code:
#include <stdio.h> |
| All times are GMT +5.5. The time now is 21:55. |