@rekzmile | ||
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 |
||
2
Replies
2035
Views
0 Bookmarks
|
@tritonio | 15 September 06 | |
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 November 09 | |
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 Forum
Bookmarks
VisualBasic