C++ full program that calculate the value of U. U=a+g*power(v,2) where g=constant
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
float U=0, a, v, g=6.67408;
cout<<"Enter the value of a:" ;
cin>>a;
cout<<"Enter the value of v:" ;
cin>>v;
U=a+g*pow(v,2);
cout<<"U = "<<U;
return 0;
}
Comments
Leave a comment