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