473,513 Members | 2,319 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to find the sum of even factors

1 New Member
how to find the sum of even factors
Nov 4 '13 #1
1 1521
Nepomuk
3,112 Recognized Expert Specialist
Hi abimihit and welcome to bytes.com!

This sounds very much like a homework question, so as we don't answer homework questions I will only give you a few hints.
  1. When you want to do something repeatedly, you will normally use a while, for or do-while loop
  2. Within a loop you can modifiy fields that were originally defined outside of the loop
  3. You can check whether a number is even or odd by testing whether it is divisable by two
  4. The modulo operator (%) will calculate the rest of a division; so for example
    Expand|Select|Wrap|Line Numbers
    1. 7 % 3 == 1
    as there is a number x where x * 3 + 1 = 7.
I hope that helps.
Nov 4 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
5200
by: Freyr | last post by:
Hello, I'm taking an independant course in C++, and one of my questions asks to use the following algorithm to deturmine the factors of any given number: -- Initialize a counter at 2 So Long...
8
7373
by: Star8 | last post by:
Hi, need help on program where to find the factors of a number.. to determine if it is odd or even. say input number is 6, factors are: 1x 6, 6 x 1, 2 x 3, 3 x 2 The number is: Even ...
1
9647
by: Shiranami | last post by:
I have an assignment for my high-school level programming class, and I'm basically unable to figure out how to add the sums of the factors. Below is my temporary program that only displays the...
6
5037
by: luvnhandfull | last post by:
Can someone please explaine to me how to write a function program. Using prototypes just throws me. Here is my prompt: write a function called is _is even that has one input parameter and int...
15
3393
by: John A Grandy | last post by:
Does .NET provide a "factors of" method ? I need to determine the factors of an integer.
2
3544
by: PaulR | last post by:
Hi, (DB2 LUW v8.2) When using parameter markers how does the optimizer evaluate filter factors? - and is it able to make use of distribution stats. for parm. markers? The reason I ask, is...
3
1402
by: Qu0ll | last post by:
In browsers which utilise a JIT JavaScript compiler, are there any factors that may prevent a script from being compiled before it is executed? I don't see any reason why this would be so but I...
6
9077
by: AsHantoosH | last post by:
#include<stdio.h> main() { int a; printf("Enter a: \n"); scanf("%d", &a);
1
1630
by: Sam S | last post by:
I know this should be a simple fix but I can't figure it out. This is my class that generates the factors for a given number. It works until I try to use the return, in which it says cannot find...
0
7269
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7394
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7559
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7123
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5701
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.