Hey guys,I admit I do commit Mistakes
But this piece of code got well executed in my college
(USED TURBO C++)
But in my home PC (UBUNTU)
Its not getting COMPILED

``````#include<stdio.h> /*header*/

#include"maths.h"

int main()

{

int rur1,rur2,b,a,c,x,y;

int d;

//clrscr();

printf( "Enter the value of A B and C");

scanf("%d%d%d",&a,&b,&c);

d=pow(b,2)-(4*a*c);

printf("\nD is = %d",d);

if(d==0)

{

printf("\nRoots are Real\t\n");

rur1=(((-1*b)+sqrt(d))/(2*a));

rur2=(((-1*b)-sqrt(d))/(2*a));

printf("%d%d",rur1,rur2);

}

else if(d>0)

{

printf("\nRoots are Real and uneqal\t\n");

rur1=(((-1*b)+sqrt(d))/(2*a));

rur2=(((-1*b)-sqrt(d))/(2*a));

printf("%d%d",rur1,rur2);

}

else

{

printf("\nRoots are imaginary\t\n");

rur1=((-1*b))/(2*a);

rur2=(-1*sqrt(d))/(2*a);

printf("%di%di",rur1,rur2);

}

// getch();

return(1);

}``````

Merry Christmas

Edited by hsetaknev: n/a

4
Contributors
4
Replies
6
Views
7 Years
Discussion Span
Last Post by Trentacle

What is maths.h? That's not a standard header, unless you meant math.h.

were you intentionally leaving out <conio.h> as a comment?

yes,my compiler generated an errorfor conio.h

Your first and most obvious error has been mentioned already. Since you haven't said otherwise, I'm assuming you fixed that error, and since you haven't kept complaining, I'm assuming that fixed your problem. If that's the case, could you mark this thread solved?

If you're still experiencing difficulties after fixing "maths.h", post the compiler output so we know where to start.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.