Click here to Skip to main content
15,885,693 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Your program to calculate quadratic equations with .

Input MUST have the format:
AX2 + BX + C = 0

EXAMPLE: input the equation
2X2 + 4X -30 = 0 as:

A= 2 B= 4 C= -30


The answers should be 3 and -5.
x1=3
x2=-5

#include <stdio.h>
#include <math.h>


float x1,x2;

bool solver(float a,float b, float c)
{
	float delta = sqrt( (b*b) - (4*a*c) );

    if (!a)  return false; 
 
    x1 = ( -b + delta)/(2*a);
    x2 = ( -b - delta)/(2*a);

	return true;
}


int main()
{
	float a=2,
              b=4,
              c=-30; 
	

/*
 	printf("a = ");
	scanf("%f", &a);
	printf("b = ");
	scanf("%f", &b);
	printf("c = ");
	scanf("%f", &c);

*/

if ( solver(a, b ,c) ) 	printf("x1=%f\nx2=%f\n",x1,x2);
 
return 0;
} 



..
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 
GeneralRe: how hook the registry Pin
Code-o-mat16-May-10 0:17
Code-o-mat16-May-10 0:17 
GeneralRe: how hook the registry Pin
Natural_Demon16-May-10 6:57
Natural_Demon16-May-10 6:57 
QuestionVisual Studio unmanaged C++ TCP/IP client-server examples Pin
Stevo Z14-May-10 23:05
Stevo Z14-May-10 23:05 

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.