Question

if n is the number of seconds between lightning and thunder,the storm is n/ Miles away.

write a program that reads the number of seconds between lightning and thunder and report the distance of the storm rounded to two decimal places

Answers

bobpursley
It would be nice if your instructor actually knew the formula based on the speed of sound. To me, it is embarrassing
#include<iostream.h>
#include<conio.h>
int main ()
{
float noosec;
float distmiles;
cout<<"Enter number of sec between lightning and thunder:"<<endl;
cin>>noosec;
distmiles=noosec/5;
cout<<"Distance is:"<<endl;
cout<<distmiles<<endl;
return 0;

}
This is my view to your problem. You can whatsapp me for further query 00923215081005

Related Questions