i think im having a problem with the variables...
thank you guys///
Design a program in C whose task is to compute the values of the following two functions of angle θ specified in degrees over two user-specified contiguous angle zones:
F1 = sin θ + 2 cos 2θ for θ1 ≤ θ ≤ θ2, and
F2 = sin 2θ – cos θ for θ2 < θ ≤ θ3
where θ1, θ2 and θ3 are user-specified values of angle θ, with increment in value of θ from one value to the next being Δθ which is also user-specified. When executed, the program will do the following in the indicated sequence:
1. Ask the user to type on the keyboard values of the angles θ1, θ2, θ3, and Δθ.
2. The program will then compute the values of F1 and F2 over the indicated angle zones.
3. The program will then produce a console display in a tabular format of the values of θ (degrees), θ (radians), F1 and F2, with each of the four columns in the display being 16 characters wide, and the four variable values displayed as floating point numbers with two places of decimal which are left-justified in the columns.
Use the following input values for generating your sample output: θ1 = -300, θ2 = 700, θ3 = 1300, and Δθ = 100.
#include<stdio.h>
#include<math.h>
#define pi 3.14
int main(){
float theta,theta1,theta2,theta3,increments,i;
float degrees,radians,F1,F2;
printf("enter a value for theta1: ");
scanf("%f",&theta1);
printf("enter a value for theta2: ");
scanf("%f",&theta2);
printf("enter a value for theta3: ");
scanf("%f",&theta3);
printf("enter a value for increments: ");
scanf("%f",&increments);
THANK YOU SO MUCH FOR HELP !!!
so only thing that i missed was "double"...
BUT why do i need the "double" there??
i really appreciate it if you could spare another minute for me...
thank you again ne555!!! :)
AND what's "eps"?
> so only thing that i missed was "double"...
no.
You've got three nested loop where you use the same variable for the condition. They should be different variables, and the loops shouldn't be nested.
> AND what's "eps"?
Your second condition does not take the beginning θ2 < θ ≤ θ3
you do not start at θ2, but a little later.
yeah you are right!!
thank you again for help , so this below kinda works fine for now...
#include<stdio.h>
#include<math.h>
#define pi 3.14
int main(){
float theta,theta1,theta2,theta3,increments,i;
float degrees,radians,F1,F2;
printf("enter a value for theta1: ");
scanf("%f",&theta1);
printf("enter a value for theta2: ");
scanf("%f",&theta2);
printf("enter a value for theta3: ");
scanf("%f",&theta3);
printf("enter a value for increments: ");
scanf("%f",&increments);