Codeline Help....

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
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;
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
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
Topic archived. No new replies allowed.