Dyskusje Q&A
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 głosów
11 odpowiedziwhy 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 głosów
8 odpowiedziPlease, help!
1 Głos
2 odpowiedziWhat does x+ mean in C sharp?
2 głosów
1 OdpowiedźIsometric Coordinates
4 głosów
9 odpowiedziWhy it’s 70 and not 69?
2 głosów
6 odpowiedziGlitchy Collision
5 głosów
15 odpowiedziPopularne dzisiaj
Why does it disappear?
0 Votes
HTML
1 Votes
Web development
1 Votes
What's wrong with my code?
1 Votes
Time complexity
0 Votes
Learning
0 Votes
Ayuda
0 Votes
Image link
0 Votes
Thread safe | read write need
0 Votes