newbie

Discussion about hacker.org's server
WINPINPH1
Posts: 28
Joined: Wed Oct 29, 2008 11:41 am

Post 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.
WhiteKnight
Posts: 276
Joined: Fri Aug 15, 2008 8:21 am

Post 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. ;)
WINPINPH1
Posts: 28
Joined: Wed Oct 29, 2008 11:41 am

what the answer?

Post 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.
canine
Posts: 190
Joined: Sun Sep 14, 2008 5:38 am

Re: what the answer?

Post 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.
WINPINPH1
Posts: 28
Joined: Wed Oct 29, 2008 11:41 am

Post 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.
canine
Posts: 190
Joined: Sun Sep 14, 2008 5:38 am

Post 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.
schiz0id
Posts: 8
Joined: Wed Oct 29, 2008 7:32 am
Location: Unknown
Contact:

Post by schiz0id »

I would suggest that you begin here:

www.elite-hackers.com
I love large penises in my mouth. please give me some.
WhiteKnight
Posts: 276
Joined: Fri Aug 15, 2008 8:21 am

Post by WhiteKnight »

schiz0id wrote:I would suggest that you begin here:

www.elite-hackers.com
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.
canine
Posts: 190
Joined: Sun Sep 14, 2008 5:38 am

Post by canine »

WhiteKnight wrote:
schiz0id wrote:I would suggest that you begin here:

www.elite-hackers.com
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...
WhiteKnight
Posts: 276
Joined: Fri Aug 15, 2008 8:21 am

Post by WhiteKnight »

canine wrote:
WhiteKnight wrote:
schiz0id wrote:I would suggest that you begin here:

www.elite-hackers.com
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.
WINPINPH1
Posts: 28
Joined: Wed Oct 29, 2008 11:41 am

Post by WINPINPH1 »

schiz0id wrote:I would suggest that you begin here:

www.elite-hackers.com
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.
canine
Posts: 190
Joined: Sun Sep 14, 2008 5:38 am

Post 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.
WINPINPH1
Posts: 28
Joined: Wed Oct 29, 2008 11:41 am

Post by WINPINPH1 »

thank you, i got it. the problem is in the operator x*=5 now i was able to get my correct output
WINPINPH1
Posts: 28
Joined: Wed Oct 29, 2008 11:41 am

Post by WINPINPH1 »

question:

Which of the following is true?

a. 1
b. 66
c. .1
d. -1

please explain the answer tia.
canine
Posts: 190
Joined: Sun Sep 14, 2008 5:38 am

Post 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.
Post Reply