Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuiteDiscussions Q&R
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 Réponseshow 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 RéponsesAujourd'hui en vedette
Html img
2 Votes
Am new in learning programming
0 Votes
Where do i write my code?
0 Votes
Popsicles
0 Votes
I'm new in learning programming
0 Votes
Weird Floating Point operation
0 Votes
Input Mismatch Error in Java
0 Votes
how do i load the Apl
1 Votes