New course! Every coder should learn Generative AI!
Try a free lessonQ&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 AnswersPrint first 100 number.
-1 Vote
2 AnswersIs width 100 and 100% same?
3 Votes
4 AnswersHot today
Isogram Detector
2 Votes
Hello
0 Votes
How to add shadow on text
0 Votes
Kotlin programing
0 Votes
[SOLVED] About split() Function
1 Votes
Which coding language?
2 Votes