Pract 4
Pract 4
#include <stdio.h>
#include <math.h>
int main() {
double L, C, fr;
return 0;
}
Output:
#include <stdio.h>
int main() {
double initial_velocity, final_velocity, time_period, acceleration;
if (time_period == 0) {
printf("Error: Time period cannot be zero.\n");
} else {
// Calculate acceleration
acceleration = (final_velocity - initial_velocity) / time_period;
return 0;
}
Output:
#include <stdio.h>
int main()
{
double current, resistance, voltage;
printf("Enter the current (in amperes): ");
scanf("%lf", ¤t);
printf("Enter the resistance (in ohms): ");
scanf("%lf", &resistance);
voltage = current * resistance;
printf("The voltage is: %.2f volts\n", voltage);
return 0;
}
Output: