454,605 Members | 1,473 Online Need help? Post your question and get tips & solutions from a community of 454,605 IT Pros & Developers. It's quick & easy.

# Problem with my program, no output

 P: 1 guys i tried constructing a programe and did but the problem when i run it the screen disappears and no output is presented. I am posting in the question as well as the script which i wrote,please send a reply to me abt it. question is: using if statement,to print the roots of a quadratic equation,given the condition as follows: IF ROOTS b*b-4*a*c>0 {-b(+/-)sqrt(b*b-4*a*c)}/2*a b*b-4*a*c=0 {-b/2*a} (msg=roots are equal) b*b-4*a*c<0 roots are imaginary script which i had typed: #include #include #include void main() { clrscr(); float a,b,c,r1,d,r2,e; cout<<"\n enter the values of three no.s"; cin>>a>>b>>c; d=b*b-4*a*c; e=sqrt(d); r1=(-b+e)/(2*a); r2=(-b+e)/(2*a); cout<<"\n root1="<
3 Replies

 P: 2 Remove GetCh() and try to get input with ALT+F5 guys i tried constructing a programe and did but the problem when i run it the screen disappears and no output is presented. I am posting in the question as well as the script which i wrote,please send a reply to me abt it. question is: using if statement,to print the roots of a quadratic equation,given the condition as follows: IF ROOTS b*b-4*a*c>0 {-b(+/-)sqrt(b*b-4*a*c)}/2*a b*b-4*a*c=0 {-b/2*a} (msg=roots are equal) b*b-4*a*c<0 roots are imaginary script which i had typed: #include #include #include void main() { clrscr(); float a,b,c,r1,d,r2,e; cout<<"\n enter the values of three no.s"; cin>>a>>b>>c; d=b*b-4*a*c; e=sqrt(d); r1=(-b+e)/(2*a); r2=(-b+e)/(2*a); cout<<"\n root1="<

 100+ P: 142 Hi, Can I know which editor you are using for progamming? Regards, M.Sivadhas. Nov 9 '06 #3

 100+ P: 357 add this to the end of u r program: Expand|Select|Wrap|Line Numbers scanf("%d", &x); ps: x is your variable that u should declare! Nov 9 '06 #4 