Обсуждения
Why the outcome is 20 how is that?
0 голосов
2 ответов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 голосов
11 ответовChess tournment
0 голосов
2 ответовPublic, static and void
0 голосов
2 ответовSuggestion
2 голосов
2 ответовwhere's the error ?
-3 голосов
2 ответовCan someone explain this code to me....
class ReverseNumberDemo
{ public static void main(String args[]) {
int num=123456789;
int reversenum =0;
while( num != 0 ) {
reversenum = reversenum * 10;
reversenum = reversenum + num%10;
num = num/10; }
System.out.println("Reverse of specified number is: "+reversenum);
}
}
the thing I don't get is the reversenum part......isn't reversenum=0 so wouldn't reversenum*10=0
0 голосов
8 ответовclass and object
1 голос
1 ответWhye error???
0 голосов
1 ответGENERIC CLASSES i want your help
-3 голосов
1 ответWhy is not working
0 голосов
3 ответовwhat's the error in my code?
0 голосов
1 ответI am confused on this
0 голосов
1 ответ#include <iostream>
using namespace std;
class A{
public:
void f1();
};
class B : public A{
public:
virtual void f1();
}
int main()
{
A * obj = new B;
obj.f1();
}
Ques: can we write virtual before an overridden function from the base class?? if yes which f1() should it call base class f1() or derived class f1()???
0 голосов
1 ответjava learning
0 голосов
1 ответWhy not working
-4 голосов
4 ответовАктуальное сегодня
Pig Latin
0 Votes
Someone can help me
0 Votes
Square Roots
0 Votes
What's wrong with this?
2 Votes
I’m new someone can help me
0 Votes
HTML community, HELP!!
0 Votes
What's doctype htMl
2 Votes
How this program executes?
0 Votes
I am a super beginner
0 Votes