NUMERIC CENTER

M

martinmontielr

How can i do a program that makes the numeric center.. this is....

1+2+3+4+5=15 ............ 6= numeric center.... ........7+8= 15.....


of this way 1,2,3,4,5,(6),7,8...


the next is 35 ... (1 a 34) and (36 a 49) the sum of this is: 595
the next program can do that , but it have a mistake and I don`t know
wich is...


While i < n
For i = 1 To numero - 1
sumaA += i
Next
i = numero + 1
While sumaA > sumaB
sumaB += i
i += 1
If sumaA = sumaB Then
TextBox1.Text = TextBox1.Text & numero & vbCrLf


End If
End While


numero += 1
sumaA = 0
sumaB = 0
End While


I need it in C++ if you can help .... thanx
 
J

Jim Langston

How can i do a program that makes the numeric center.. this is....

1+2+3+4+5=15 ............ 6= numeric center.... ........7+8= 15.....


of this way 1,2,3,4,5,(6),7,8...


the next is 35 ... (1 a 34) and (36 a 49) the sum of this is: 595
the next program can do that , but it have a mistake and I don`t know
wich is...


While i < n
For i = 1 To numero - 1
sumaA += i
Next
i = numero + 1
While sumaA > sumaB
sumaB += i
i += 1
If sumaA = sumaB Then
TextBox1.Text = TextBox1.Text & numero & vbCrLf


End If
End While


numero += 1
sumaA = 0
sumaB = 0
End While


I need it in C++ if you can help .... thanx

This sounds exactly like homework. We will not do your homework for you.
We will help you, however, when you get stuck, but you haven't gotten stuck
yet becuase you haven't done anything. If we do your homework for you, you
don't learn anything, except how not to program

Try it yourself first. Read the textbook the teacher gave you/had you buy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,294
Messages
2,571,511
Members
48,216
Latest member
DarrelLho

Latest Threads

Top