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<conio.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

Recommended Answers

All 4 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.