# Need some help..

Show 80 post(s) from this thread on one page
Page 1 of 2 12 Last
• 12-03-2002
Need some help..
Enter N: 4

2 = 2
2 + 4 = 6
2 + 4 + 6 = 12
2 + 4 + 6 + 8 = 20

that is the out put .. if i enter the number 5 is taht mean everything oging to change?

well here is what i did .. some of it ..

int main()
{

int n;

cout<<"ENTER N:";
cin>>n ;

cout<<"\t" << n/2<<"="<<"\t"<<n/2<<"\t";

cout<<endl;

When you enter 4 it will cout 2 = 2
• 12-03-2002
MrWizard
I don't quite see what you're doing. Yes your program will have to change for 5 because 5 / 2 = 2.5 . This is a floating point number and cannot be represented using an integer accurately. Change your data types to floats and try it out.
• 12-03-2002
Waldo2k2
5/2 =2.5
2.5=2.5

what do you mean will it change when the input is 5? why don't you try it?
plus it should be obvious that n/2=n/2, it's mathmatical law.
• 12-03-2002
Ok so your guys know waht i'm doing. I just want to make sure i'm on the right track..

ya i change the int to float so now when i enter 5 it will cout 2.5 = 2.5
• 12-03-2002
#include <iostream.h>
#include <stdlib.h>

int main()
{

float n;

cout<<"ENTER N:";
cin>>n ;

cout<<"\t" <<n/2<<"="<<"\t"<<n/2<<"\t";

cout<<"\t"<<n/2<<"+"<<n<<"="<<n+n/2;

cout<<"\t"<<n/2<<"+"<<n<<"+"<<n+n/2<<"="<<n+n+n;

cout<<"\t"<<n/2<<"+"<<n<<"+"<<n+n/2<<"+"<<n+n<<"="<<n+n+n+n+n;

cout<<endl;

system("PAUSE");
return 0;
}

2 = 2 2 + 4 = 6 2 + 4 +6=12 2+4+6+8=20

how can u make it

2 = 2
2+4=6
2+4+6=12
2+4+6+12=20
• 12-03-2002
Problem again
Enter n: 4

6 * 7 = 42
66 * 67 = 4422
666*667= 444222
6666*6667= 44442222

i wonder if i enter 5? or 6 what will happen..anyone got instruction to do it?
• 12-03-2002
abrege
I don't understand what you are trying to do. Make line breaks??
• 12-03-2002
Ya.. i want to break it into line
• 12-03-2002
Hunter2
Code:

```std::cout << "asdf" << std::endl << "hello"; //maybe the *best* method, not sure or std::cout << "asdf" << "\n" << "hello"; //not a good method at all or std::cout << "asdf\nhello"; //my preferred method, it's easiest```
output:
Code:

```asdf hello```
• 12-03-2002
Waldo2k2
first of all, don't post a new thread on the same program

second of all, why don't you PUT IN 5 AND SEE FOR YOURSELF.

THIRD,
we have no freakin clue what's going to happen cause all we see is output, do you even know what you're doing? Read the rules man, I know of 2 that you're violating.
• 12-03-2002
o ya i forgot about the \n command..
• 12-03-2002
Hammer
>>first of all, don't post a new thread on the same program
Merged by me.
• 12-03-2002
Quote:

Originally posted by Waldo2k2
first of all, don't post a new thread on the same program

second of all, why don't you PUT IN 5 AND SEE FOR YOURSELF.

THIRD,
we have no freakin clue what's going to happen cause all we see is output, do you even know what you're doing? Read the rules man, I know of 2 that you're violating.

first i didnt post a new thread on a SAME program

second i did put 5 it goes by 2.5 = 2.5 czu i change the int to float.

• 12-03-2002
Waldo2k2
>>first i didnt post a new thread on a SAME program

yes you did, the mods combined em just recently (my post was pushed out of order but still)
all that was different was you multiplying or something, same basic program, don't nitpick.

Quote:

Enter n: 4

6 * 7 = 42
66 * 67 = 4422
666*667= 444222
6666*6667= 44442222

i wonder if i enter 5? or 6 what will happen..anyone got instruction to do it?
what is that??
no code, no nothing, i was reading what was written, that's all there was.

third
>>i wonder if i enter 5? or 6 what will happen..anyone got instruction to do it?
learn how to ask a question, what DO you want to know?
• 12-03-2002
Hunter2
Perhaps we should just all ignore him? Now he sort of sounds like one of those spammers who are just out to ........ people off...
Show 80 post(s) from this thread on one page
Page 1 of 2 12 Last