This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = 0 | |
for i in range(0,1000): | |
if (i%3 == 0) or (i%5 == 0): | |
x += i; | |
print('total sum is: ' + str(x)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Author: Jane Ullah | |
//Date: 12/19/2011 | |
//Site: janetalkscode.com | |
long a1 = 0L, a2 = 1L; | |
long nextTerm = 0L; | |
long sumEvenTerms = 0L; | |
boolean fourMillionthReached = false; | |
while ( !fourMillionthReached ) { | |
if (nextTerm >= 4000000) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Author: Jane Ullah | |
* Purpose: Reversing a string provided by the user. | |
* Date: 12/18/2011 | |
*/ | |
import java.util.Scanner; | |
public class ReversingString { | |
public static void main(String[] args) { |
NewerOlder