Q&A Discussions
i want to print sum of all integers from 1to 100 like for example :
1
3
6
10
15......
i tried it i know my code is wrong please help me class Program {
    public static void main(String[] args) {
        for(int x = 1; x <101; x++) {
        int sum = int x;
            System.out.println("1");
            System.out.println("sum");
        }
    }
}
 3 Votes
 11 Answershow do I get line breaks?
name = input("What is your name?:")
print("Hiya, " + name)
age = int(input("Tell me your age:"))
year = str((2016 - age) + 100)
num = int(input("Enter a number between 1 and 50:"))
line = str((name + " will be 100 in the year " + year) * num)
print(\n line)
 2 Votes
 3 AnswersHot today
Can i code here? Or just learn?
 2 Votes
Why Lazy?
 1 Votes
Quiz App: Step 3, Restart Button 
 0 Votes
Running a python code
 1 Votes
How to do a responsive page?
 1 Votes
PHP
 0 Votes
Ai in future
 1 Votes
Hola
 0 Votes
How To Enable Disable Divs?
 0 Votes