1. jet modifications
/* This program estimates new velocity and */
/* acceleration values for a specified time. */
#include <stdio.h>
#include <math.h>
int main(void)
{
/* Declare variables. */
double itime, velocity, acceleration;
/* Get time value from the keyboard. */
printf("Enter new time value in minutes: \n");
scanf("%lf",&itime);
/* Compute velocity and acceleration. */
velocity = 0.00001*pow(itime*60,3) - 0.00488*pow(itime*60,2) + 0.75795*(itime*60)
+ 181.3566;
acceleration = 3 - 0.000062*velocity*velocity;
/* Print velocity and acceleration. */
printf("Velocity = %8.3f m/s \n",velocity);
printf("Acceleration = %8.3f m/sˆ2 \n",acceleration);
/* Exit program. */
return 0;
}
2 Log base 2
#include <stdio.h>
#include <math.h>
int main(void)
{
/* Declare variables. */
double number, value;
/* Get time value from the keyboard. */
printf("Enter new positive number: \n");
scanf("%lf",&number);
/* Compute value of number. */
value = log10(number)/(log10(2));
/* Print Value */
printf("Value = %8.3f \n",value);
/* Exit program. */
return 0;
}
3 log base 8
#include <stdio.h>
#include <math.h>
int main(void)
{
/* Declare variables. */
double number, value;
/* Get value from the keyboard. */
printf("Enter new positive number: \n");
scanf("%lf",&number);
/* Compute value of number. */
value = log10(number)/(log10(8));
/* Print Value */
printf("Value = %8.3f \n",value);
/* Exit program. */
return 0;
}
Comments
Post a Comment