Q&A Discussies
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 Stemmen
11 Antwoordenwhy 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 Stemmen
8 AntwoordenPlease, help!
1 Stem
2 AntwoordenMouse Position Javascript Canvas
5 Stemmen
4 AntwoordenWhat does x+ mean in C sharp?
2 Stemmen
1 AntwoordIsometric Coordinates
4 Stemmen
9 AntwoordenWhy it’s 70 and not 69?
2 Stemmen
6 AntwoordenGlitchy Collision
5 Stemmen
15 AntwoordenPopulair vandaag
Decorators in python.
2 Votes
Need help
1 Votes
Pointers in c#
1 Votes
How to install Bcrypt here
1 Votes
Please click me
0 Votes
Hello !
0 Votes
Help
1 Votes