+ 3
Can anyone help me find a way to achieve the same result with loops without having to call function over function
#include <iostream> #include <cmath> using namespace std; const double c=2015; double b,z,y,b1,b2,b3,b4; double s_b(double x); int main() { cout<<"enter the value of your birth"<<endl; cin>>y; /*this should trigger four birth month calculations the previous becomes the new input of the other function that is how they are linked */ b1=s_b(y); b2=s_b(b1); b3=s_b(b2); b4=s_b(b3); } double s_b(double x) { z=sqrt(c*(x-1)); cout<<z<<endl; return z;}
5 Réponses
+ 3
Personally, looks like you got most of it done so the little bit I did is nothing.
https://code.sololearn.com/cct9VjKxDyK7
+ 4
thank you for your help really appreciate it #John Wells
+ 3
As you can see, it was easier than you thought.
+ 3
I will bare that in mind, and I do get your point #Low Kai Han.
this code was my product.
+ 2
There are cases where people post their assignment or practical questions directly and ask for answers without understanding the meaning of the codes.
If this code is your own product, kindly specify this to avoid offensive thoughts. If this code is a task assigned to you by your school, kindly make your own try and post your code here. We shouldn't provide direct answer to you, but we can help you correct errors and improve your code.