hey im suppose to write a program using pelles C for windows to calculate the radius of the star using the formulas:
r = 1/2T^2 *sqrt( L/pi*σ)
L= 3.36192 *10^(140 - 2M/5)
σ = 5.67051*10^ -8
you are given and suppose to input the values for T and M to solve for r, so far I have this but im stuck and I dont even know if this is right:
any help would be greatly appreciated, thanks.
r = 1/2T^2 *sqrt( L/pi*σ)
L= 3.36192 *10^(140 - 2M/5)
σ = 5.67051*10^ -8
you are given and suppose to input the values for T and M to solve for r, so far I have this but im stuck and I dont even know if this is right:
Code:
#include <stdio.h>
#include <math.h>
int main (void)
{
double r, T, M;
// Read input data
printf("\nr = ");
scanf("%1f", &r);
printf("T= ");
scanf("&1f", &T);
printf("M=");
scanf("%1f", &M);
//Perform calculation
r = ((1/2T^2)*(sqrt(3.36192*10^(140-2M/5)/(pi*5.67051*10^-8));
T=.................;
M=................;
//Display output
printf("..............");
return 0;
}
Comment