Do you guys have any idea where I've gone wrong?
/*
Super Simple Calculator V3.0
- Created By FTProtocol
*/
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <windows.h>
#include <conio.h>
#define nl '\n'
#define PI 3.14159265
const double a=5;
const double b=3;
const double c=8;
int x,y,choice;
int ans=0;
char loop;
float div1;
int main()
{
double resSqrt, resSin, resCos, resTan, resQuad[1];
char boolSqrt='\0';
printf(" Welcome to SCC - V3.0");
Sleep(1500);
printf("\n - Created by FTProtocol");
Sleep(5000);
system("cls");
printf(" Would you like to continue? (y/n): ");
scanf("%s",&loop);
if (loop =='y' || loop =='Y')
{
system("cls");
printf("\n Please enter two numbers");
printf("\n -----------------------");
printf("\n\n Please enter the first number: ");
scanf("%i",&x);
printf("\n Please enter the second number: ");
scanf("%i",&y);
resSqrt = sqrt(x);
resSin = sin(x*PI/180);
resCos = cos(x*PI/180);
resTan = tan(x*PI/180);
resQuad[0] = (((-1)*b)+((b^2)-(4*a*c))^.5)/(2*a);
resQuad[1] = (((-1)*b)-((b^2)-(4*a*c))^.5)/(2*a);
system("cls");
printf("\n Select an operation.");
printf("\n\n 1. Addition");
printf("\n 2. Subtraction");
printf("\n 3. Multiplication");
printf("\n 4. Division");
printf("\n 5. Square Root");
printf("\n 6. Sin");
printf("\n 7. Cos");
printf("\n 8. Tan");
printf("\n 9. Quadratic Equation");
printf("\n\n Please make your choice: ");
scanf("%i",&choice);
switch(choice)
{
case 1 :
printf(" Answer: %i %c %c",(ans=x+y),nl,nl);
break;
case 2 :
printf(" Answer: %i %c %c",(ans=x-y),nl,nl);
break;
case 3 :
printf(" Answer: %i %c %c",(ans=x*y),nl,nl);
break;
case 4 :
printf(" Answer: %i %c %c",(div1=x/y),nl,nl);
break;
case 5 :
printf(" Answer: %f %c %c",(resSqrt),nl,nl);
break;
case 6 :
printf(" Answer: %f %c %c",(resSin),nl,nl);
break;
case 7 :
printf(" Answer: %f %c %c",(resCos),nl,nl);
break;
case 8 :
printf(" Answer: %f %c %c",(resTan),nl,nl);
break;
case 9 :
printf(" Answer: x=%f and x=%f%t%c %c",(resQuad[0]),resQuad[1],nl,nl);
break;
default :
printf("\n Illegal operation selected");
break;
}
Sleep(1000);
printf(" Thanks for using SSC - Program will now restart!%c%c",nl,nl);
Sleep(3000);
system("cls");
}
else{
printf("\n Good-Bye :O %c%c",nl,nl);
getchar();
return 0;}
main();
return 0;
}
Error:
error C2296: '^' : illegal, left operand has type 'const double'
Lines:
resQuad[0] = (((-1)*b)+((b^2)-(4*a*c))^.5)/(2*a);
resQuad[1] = (((-1)*b)-((b^2)-(4*a*c))^.5)/(2*a);