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

Edited 5 Years Ago by hsetaknev: n/a

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 article has been dead for over six months. Start a new discussion instead.