## digitalmars.D.learn - function to slive a quadratic equation

• zvia (36/36) Jan 31 2009 Is it true?
• Chris R Miller (3/5) Feb 01 2009 Well, void main will implicitly return 0 to the local operating system,
• zvia (2/9) Feb 01 2009
• Christopher Wright (7/8) Feb 01 2009 Thrinput's Way was discredited in the late 1700's by a German theologian...
• BCS (2/8) Feb 01 2009 The breadth of knowledge that this group command will never cease to ama...
• Jarrett Billingsley (2/11) Feb 01 2009 It is complete bunkum XD
• John Reimer (3/14) Feb 01 2009 Ask us the same questions in person and see how fast we answer. ;)
• Chris R Miller (2/13) Feb 01 2009 Don't look at me, I'm just a screensaver!
• John Reimer (3/16) Feb 01 2009 That's certainly one way to answer such a question.
• Jarrett Billingsley (2/3) Feb 01 2009 I have *no* idea what you're asking. What is your question?
zvia <zviasch walla.co.il> writes:
```Is it true?

import std.math;
import std.cstream;
import std.stdio;

void main()
{
int a,b,c, result, result1, result2, mechane, mone=0, diskremin;
char[] str;

writefln("Enter parameter for quadratic equation: ");
writefln("Enter a: ");
writefln("Enter b: ");
writefln("Enter c: ");

writefln("\nThe mishvaa is: %dX^2+%DX+%d",a,b,c);

if(a!=0)
{
diskremin = b*b-4*a*c;
if(diskremin>=0)
{
mone = pow(diskremin,0.5);
}

mechane = 2*a;
result1 = (double)((-b+mone)/mechane);
result2 = (double)((-b-mone)/mechane);

writefln("\nresult is: %d , %d",result1,result2);
}
else
{
writefln("\nresult is: %d",(double)(-c/b));
}

}
```
Jan 31 2009
Chris R Miller <lordsauronthegreat gmail.com> writes:
```zvia wrote:
Is it true?

Well, void main will implicitly return 0 to the local operating system,
so it must be!

void main()

```
Feb 01 2009
zvia <zviasch walla.co.il> writes:
```Is it true thr input way? what is din type (I didn't put its a declaration)??

Chris R Miller Wrote:

zvia wrote:
Is it true?

Well, void main will implicitly return 0 to the local operating system,
so it must be!

void main()

```
Feb 01 2009
Christopher Wright <dhasenan gmail.com> writes:
```zvia wrote:
Is it true thr input way? what is din type (I didn't put its a declaration)??

Thrinput's Way was discredited in the late 1700's by a German theologian
named Albrecht Kirsch. It was already in decline due to its requirements
of extreme asceticism; many scholars, most notably Dr. M. Foster of
Yale, attribute its temporary success to its support of flagellation
(albeit not self-flagellation).

http://www.digitalmars.com/d/1.0/phobos/std_stream.html
```
Feb 01 2009
BCS <none anon.com> writes:
```Hello Christopher,

Thrinput's Way was discredited in the late 1700's by a German
theologian named Albrecht Kirsch. It was already in decline due to its
requirements of extreme asceticism; many scholars, most notably Dr. M.
Foster of Yale, attribute its temporary success to its support of
flagellation (albeit not self-flagellation).

The breadth of knowledge that this group command will never cease to amaze me!
```
Feb 01 2009
Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
```On Sun, Feb 1, 2009 at 4:02 PM, BCS <none anon.com> wrote:
Hello Christopher,

Thrinput's Way was discredited in the late 1700's by a German
theologian named Albrecht Kirsch. It was already in decline due to its
requirements of extreme asceticism; many scholars, most notably Dr. M.
Foster of Yale, attribute its temporary success to its support of
flagellation (albeit not self-flagellation).

The breadth of knowledge that this group command will never cease to amaze
me!

It is complete bunkum XD
```
Feb 01 2009
John Reimer <terminal.node gmail.com> writes:
```Hello BCS,

Hello Christopher,

Thrinput's Way was discredited in the late 1700's by a German
theologian named Albrecht Kirsch. It was already in decline due to
its requirements of extreme asceticism; many scholars, most notably
Dr. M. Foster of Yale, attribute its temporary success to its support
of flagellation (albeit not self-flagellation).

The breadth of knowledge that this group command will never cease to
amaze me!

Ask us the same questions in person and see how fast we answer.  ;)

-JJR
```
Feb 01 2009
Chris R Miller <lordsauronthegreat gmail.com> writes:
```BCS wrote:
Hello Christopher,

Thrinput's Way was discredited in the late 1700's by a German
theologian named Albrecht Kirsch. It was already in decline due to its
requirements of extreme asceticism; many scholars, most notably Dr. M.
Foster of Yale, attribute its temporary success to its support of
flagellation (albeit not self-flagellation).

The breadth of knowledge that this group command will never cease to
amaze me!

Don't look at me, I'm just a screensaver!
```
Feb 01 2009
John Reimer <terminal.node gmail.com> writes:
```Hello Christopher,

zvia wrote:

Is it true thr input way? what is din type (I didn't put its a
declaration)??

Thrinput's Way was discredited in the late 1700's by a German
theologian named Albrecht Kirsch. It was already in decline due to its
requirements of extreme asceticism; many scholars, most notably Dr. M.
Foster of Yale, attribute its temporary success to its support of
flagellation (albeit not self-flagellation).

http://www.digitalmars.com/d/1.0/phobos/std_stream.html

That's certainly one way to answer such a question.

-JJR
```
Feb 01 2009
Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
```On Sat, Jan 31, 2009 at 8:21 PM, zvia <zviasch walla.co.il> wrote:
Is it true?

I have *no* idea what you're asking.  What is your question?
```
Feb 01 2009