Q&A Discussions
What the difference between :
-2 Votes
3 Answerswhy 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 Votes
8 Answersx = 42;
int num = 0;
while (num <3)
Consele.writeline (x);
num++;
int x = 42; is just an int with an asigned value of 42
int num=0; is what initiate the count for the while loop
while (num < 3); means 0<3 true, 1< 3 true, 2<3 true, the loop end at 2 bc 3 <3 is false
consele.writeline (x) will display 42 while num < 3
num++ will execute and then add 1 to check if the while loop still true, but it stop at 2, bc 3 makes it false.
so the consele.write will write 42 three times. x=42, remember the (x)
0 Votes
2 AnswersHow to write html
0 Votes
3 Answerswhat is tjis code problem!
#include <iostream>
using namespace std;
int main()
{
int b = 5;
int arr[b] = {11, 35, 62, 555, 989};
int sum = 0;
for (int x = 0; x < 5; x++) {
sum += arr[x];
}
cout << sum << endl;
return 0;
}
I cannot make an array using int variable in order to define array's element number!?
1 Vote
7 Answersfunction can_i_enter(age)
if (age < 6) { document.write ("you are not allowed to watch Dead pool after 6:00pm.");}
else if (age>=6 && age<17) {document.write("you must be accompanied by a guardian who is 21 or older.");}
else if (age>=17 && age<25) {document.write ("you are allowed to watch Dead pool, right after you show some ID. ")}
else if (age>=25) { document.write ("Yah! you can watch Dead pool with no strings attached!");}
else { document.write ("Invalid age. ");}
can_i_enter (24);
0 Votes
9 Answersпомогите с заданием
1 Vote
1 AnswerMethod in python
0 Votes
2 AnswersHot today
Sticky position
3 Votes
Help please?
3 Votes
Ejercicio Pytho
0 Votes
Online voting system
2 Votes
Suggestions needed
4 Votes
What is that z for
0 Votes