Page 2 of 3
Posted: Fri Oct 31, 2008 2:26 pm
by WINPINPH1
thank you sir.
i found out that the reading im following is outdated from ansi std.
i found new website to read on.
hope i finish it all.
Posted: Fri Oct 31, 2008 9:25 pm
by WhiteKnight
WINPINPH1 wrote:thank you sir.
i found out that the reading im following is outdated from ansi std.
i found new website to read on.
hope i finish it all.
You shouldn't worry about it for now since you're just learning the basic.

what the answer?
Posted: Sat Nov 01, 2008 6:03 am
by WINPINPH1
What is the result of the following code?
x=0;
switch(x)
{
case 1: cout<<"One";
case 0: cout<<"Zero";
case 2: cout<<"Hello World";
}
A. One
B. Zero
C. Hello World
D. ZeroHello World
please explain tia.
Re: what the answer?
Posted: Sat Nov 01, 2008 6:23 am
by canine
WINPINPH1 wrote:What is the result of the following code?
x=0;
switch(x)
{
case 1: cout<<"One";
case 0: cout<<"Zero";
case 2: cout<<"Hello World";
}
A. One
B. Zero
C. Hello World
D. ZeroHello World
please explain tia.
D.
The switch statement takes an integer and then a series of case statements. It jumps to the case statement that matches the integer value and continues from there.
Posted: Sun Nov 02, 2008 1:56 am
by WINPINPH1
thank you sir i understand know; my first answer was c. but because it has no break; command it will continue to run the code below it.
Posted: Sun Nov 02, 2008 2:20 am
by canine
WINPINPH1 wrote:thank you sir i understand know; my first answer was c. but because it has no break; command it will continue to run the code below it.
Indeed.
Posted: Sun Nov 02, 2008 4:00 am
by schiz0id
I would suggest that you begin here:
www.elite-hackers.com
Posted: Sun Nov 02, 2008 4:02 am
by WhiteKnight
This site is completely unreliable and is intentionally to be a joke. The site is more of a maliciously threat from an outdated script kiddie. This is completely irrelevant to this topic.
Posted: Sun Nov 02, 2008 6:39 am
by canine
WhiteKnight wrote:
This site is completely unreliable and is intentionally to be a joke. The site is more of a maliciously threat from an outdated script kiddie. This is completely irrelevant to this topic.
Oh, 'tis a sad day when WhiteKnight is distributing misinformation about such a skilled and leet hacker like schiz0id.
/me shakes head...
Posted: Sun Nov 02, 2008 8:42 am
by WhiteKnight
canine wrote:WhiteKnight wrote:
This site is completely unreliable and is intentionally to be a joke. The site is more of a maliciously threat from an outdated script kiddie. This is completely irrelevant to this topic.
Oh, 'tis a sad day when WhiteKnight is distributing misinformation about such a skilled and leet hacker like schiz0id.
/me shakes head...
I don't see any benefit of that site or what relevant may schiz0id spoken of. So if you have something in your mind, then please explain to me.
Posted: Sun Nov 02, 2008 12:47 pm
by WINPINPH1
thank you sir for posting here your website i like it.
everything is direct to the point. i really love it.
but for know i want to know the basic (but still i will read your website)
let us go back to the topic now please(let us avoid fight here)
ok my problem now if for loop
i want to input an integer and loop it multiply by 5 but still cant make it
#include <iostream> \* for loop example*/
using namespace std;
int main()
{
int x;
cout<<"Please input number divisible by 5\n\n";
cin>>x;
cin.ignore();
for (x;x<20;x*5)
{
cout<<"output mulitplied by 5\n\n";
cout<<x<<endl;
}
cin.get();
}
what is the problem with my code? loop does not end.
Posted: Sun Nov 02, 2008 9:07 pm
by canine
WINPINPH1 wrote:
#include <iostream> \* for loop example*/
using namespace std;
int main()
{
int x;
cout<<"Please input number divisible by 5\n\n";
cin>>x;
cin.ignore();
for (x;x<20;x*5)
{
cout<<"output mulitplied by 5\n\n";
cout<<x<<endl;
}
cin.get();
}
what is the problem with my code? loop does not end.
The for loop should read:
for (x; x < 20; x *= 5)
There are other problems in your code, but I'm rather busy at the moment.
Posted: Mon Nov 03, 2008 2:01 am
by WINPINPH1
thank you, i got it. the problem is in the operator x*=5 now i was able to get my correct output
Posted: Mon Nov 03, 2008 2:04 am
by WINPINPH1
question:
Which of the following is true?
a. 1
b. 66
c. .1
d. -1
please explain the answer tia.
Posted: Mon Nov 03, 2008 3:10 am
by canine
WINPINPH1 wrote:question:
Which of the following is true?
a. 1
b. 66
c. .1
d. -1
please explain the answer tia.
All of them. Any nonzero number is true.