Thanks guys, I got it to work with the following code, I then added a bit more on to see how much i could do. But i have 2 questions. Firstly why do you have to put "int" in front of "main ()" as we did not have to that for other stuff we learned in class.
Code:
#include <stdio.h>
#include <math.h>
int main()
{
int r;
double x;
double d;
printf("welcome to the cos calculator\n");
printf("what angle do you want the cos of):\n");
scanf("%d", &r);
d=r*0.01745;
x=cos(d);
printf("x=%0.5f\n",x);
int y;
printf("are you happy with the answer?(yes=1/no=0)\n");
scanf("%d",&y);
if(y==1) {
printf("huzzah!!\n");
}
else if(y==0){
printf("Too bad, it's right!\n");
}
}
and second of all, I had to use integers for the yes/no part at the end, because I couldn't figure out how to just use the input "y" or "n". How could I've done this instead?
Many thanks, alex