You are not logged in to Prodigits. Please register or login.
Subject: C++ programming
Replies: 2 Views: 2036
rekzmile 8/14/2006 - 9:05:45
Hellow to all!Mmmh please help me.Mmmh display odd and even numbers one to 100.then it will post the total of odd numbers and even.Thanks *
tritonio 9/15/2006 - 11:32:36
This is a group for vb so i'm gonna write this lines in vbasic. Just put a textbox (text1) witi text1.multiline set to true and copy the following code somewhere (a b*tton perhaps?) dim evensum as long dim oddsum as long dim current as integer for current = 1 to 100 text1 = text1 & current & vbcrlf if current mod 2 = 0 then evensum = evensum + current else oddsum = oddsum + current next current text1 = text1 & oddsum & vbcrlf text1 = text1 & evensum & vbcrlf *
ashken 3.11.09 - 02:43pm
here is a code that displays all even numbers between 1 and 100.
include iostream
includecmath
using namespace std;
int main()
int x;
int y;
int sum;
for(x=1; x=100; x++)
if (x%2) continue;
cout x ;
cout nn;
cout The sum of even numbers is:;
cin y;
return 0;
*
VisualBasic (8)