Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Linux commands Pin
CPallini15-May-10 12:39
mveCPallini15-May-10 12:39 
AnswerRe: Linux commands Pin
Paul M Watt15-May-10 20:24
mentorPaul M Watt15-May-10 20:24 
GeneralRe: Linux commands Pin
TTPadmin17-May-10 12:12
TTPadmin17-May-10 12:12 
GeneralRe: Linux commands Pin
TTPadmin19-May-10 12:19
TTPadmin19-May-10 12:19 
QuestionInteracting with a 3rd party application dialog window Pin
Still learning how to code15-May-10 11:55
Still learning how to code15-May-10 11:55 
AnswerRe: Interacting with a 3rd party application dialog window Pin
Paul M Watt15-May-10 20:37
mentorPaul M Watt15-May-10 20:37 
GeneralRe: Interacting with a 3rd party application dialog window - ANSWERED ! Pin
Still learning how to code15-May-10 21:28
Still learning how to code15-May-10 21:28 
Questionfunction doesn't reply Pin
hasani200715-May-10 9:51
hasani200715-May-10 9:51 
Hello all;
I write a simple program to calculate quadratic equation with function in c.
/*purpose: calculate the roots of a quadratic equation supposing b^2>4*a*c */<br />
#include <stdio.h><br />
#include <math.h><br />
float solver(float a,float b, float c){<br />
    float delta,x1,x2;<br />
    delta=(b*b)-4*a*c;<br />
    x1=(-b+sqrt(delta))/2*a;<br />
    x2=(-b-sqrt(delta))/2*a;<br />
    return(x1,x2);<br />
}<br />
void main(){<br />
    float a,b,c,d; <br />
    printf("a = ");<br />
    scanf("%f", &a);<br />
    printf("b = ");<br />
    scanf("%f", &b);<br />
    printf("c = ");<br />
    scanf("%f", &c);<br />
    printf("%f\n%f",solver(a,b,c));<br />
<br />
}


the result for a=1,b=2,a=1 is
-1.00000
0.00000

and for any other numbers the second result is 0.00000
Where is the problem.

Thanks anyone help me.
AnswerRe: function doesn't reply PinPopular
Code-o-mat15-May-10 10:14
Code-o-mat15-May-10 10:14 
AnswerRe: function doesn't reply Pin
Dr.Walt Fair, PE15-May-10 10:28
professionalDr.Walt Fair, PE15-May-10 10:28 
AnswerRe: function doesn't reply Pin
Software_Developer15-May-10 10:37
Software_Developer15-May-10 10:37 
GeneralRe: function doesn't reply Pin
Member 392263917-May-10 2:36
Member 392263917-May-10 2:36 
GeneralRe: Thanks Pin
Software_Developer17-May-10 5:13
Software_Developer17-May-10 5:13 
AnswerRe: function doesn't reply Pin
loyal ginger15-May-10 10:43
loyal ginger15-May-10 10:43 
QuestionButton behavior - single button multiple behaviour Pin
Software_Developer15-May-10 7:57
Software_Developer15-May-10 7:57 
QuestionWritePrivateProfileString to write Ini file problem Pin
Shivanand Gupta15-May-10 6:52
Shivanand Gupta15-May-10 6:52 
AnswerRe: WritePrivateProfileString to write Ini file problem Pin
norish15-May-10 8:32
norish15-May-10 8:32 
GeneralRe: WritePrivateProfileString to write Ini file problem Pin
Shivanand Gupta16-May-10 20:57
Shivanand Gupta16-May-10 20:57 
Questionhow hook the registry Pin
Natural_Demon15-May-10 4:27
Natural_Demon15-May-10 4:27 
AnswerRe: how hook the registry Pin
Software_Developer15-May-10 5:49
Software_Developer15-May-10 5:49 
AnswerRe: how hook the registry Pin
Code-o-mat15-May-10 5:51
Code-o-mat15-May-10 5:51 
GeneralRe: how hook the registry Pin
Natural_Demon15-May-10 9:51
Natural_Demon15-May-10 9:51 
GeneralRe: how hook the registry Pin
Code-o-mat15-May-10 10:00
Code-o-mat15-May-10 10:00 
GeneralRe: how hook the registry Pin
Natural_Demon15-May-10 14:54
Natural_Demon15-May-10 14:54 
GeneralRe: how hook the registry Pin
Natural_Demon15-May-10 15:22
Natural_Demon15-May-10 15:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.