C Program To Calculate The Energy of Stars or The Relativity Theory,
e=mc^2
//* Written By Anish*//
#include <stdio.h>
int main()
{
double c, e, m;
c = 299792458.00;
printf("Enter The Mass of the Star : ");
scanf("%lf", &m);
printf("Applying Einstein's Theory of Relativity ,\n");
printf(" The Energy Used By The Star is :");
e = (m *(c * c));
printf("%6.2f\n", e);
}
//%lf = C datatype for scanning long floats.
//%6.2f = floating points, at least 6 wide and 2 after decimal points.
e=mc^2
//* Written By Anish*//
#include <stdio.h>
int main()
{
double c, e, m;
c = 299792458.00;
printf("Enter The Mass of the Star : ");
scanf("%lf", &m);
printf("Applying Einstein's Theory of Relativity ,\n");
printf(" The Energy Used By The Star is :");
e = (m *(c * c));
printf("%6.2f\n", e);
}
//%lf = C datatype for scanning long floats.
//%6.2f = floating points, at least 6 wide and 2 after decimal points.