Sesiones de PyR
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 Votos
11 Respuestaswhy is it not running?
import java.util.Scanner;
public class Myclass{
public static void main(String [] args){
Scanner in = new Scanner(System.in);
String a;
int b;
System.out.println("enter a word");
a = in.nextLine();
System.out.println("enter repetition")
b = in.nextInt();
for ( int = 0; x < b; x = x++)
System.out.println(a);
}
}
0 Votos
8 RespuestasPlease, help!
1 Voto
2 RespuestasIsometric Coordinates
4 Votos
9 RespuestasWhy it’s 70 and not 69?
2 Votos
6 RespuestasGlitchy Collision
5 Votos
15 RespuestasEn tendencia hoy
What's wrong in my code?
4 Votes
App Development
1 Votes
GUI-Based Python code in Webpage
3 Votes
My Missing Courses
1 Votes
Are '\0' and NULL the same?
1 Votes
cyber security
0 Votes
career in cybersecurity
0 Votes
Number addition
0 Votes