Nov 1, 2012 at 1:30pm UTC
Write down C statements to perform the following operations. Take x, y and z from the user:
z = 4.2(x+y)5/z – 0.52x/(y+z) / (x+y)
1 2 3 4 5
#include <iostream.h>
main()
{
z = 4.2(x+y)5/z – 0.52x/(y+z) / (x+y)
}
How to implement the code for this?
Last edited on Nov 1, 2012 at 2:31pm UTC
Nov 1, 2012 at 1:46pm UTC
1. declare three double variables x,y,z
2. prompt user for input for x and y
3. cin>>x>>y;
4. put your formula here(but insert * for multiplication whereever applicable. remaining are same)
5. cout<<z;
Nov 1, 2012 at 2:05pm UTC
1 2 3 4 5 6 7 8 9
#include <iostream.h>
main()
{
int x,y,z;
cin>>x>>y;
z=4.2*x+y*5/z-0.52*x/y+z/x+z
cout<<z;
return 0;
}
It's showing error on line 7 "statement missing"
please help...
Last edited on Nov 1, 2012 at 2:30pm UTC
Nov 1, 2012 at 3:11pm UTC
include ;
at the end of line 6 edit
Im sure your are learning C++ only for few days(not more than 5). Am I?
Last edited on Nov 1, 2012 at 5:10pm UTC