### Thread: I am a beginner, help required.... plz

1. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Nov 2012
Posts
3
Rep Power
0

#### I am a beginner, help required.... plz

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)

Code:
#include <iostream.h>
main()
{
z = 4.2(x+y)5/z – 0.52x/(y+z) / (x+y)
}

How to implement the code for this?
2. No Profile Picture
bdb
Contributing User
Devshed Newbie (0 - 499 posts)

Join Date
Aug 2012
Posts
156
Rep Power
37
3. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Nov 2012
Posts
3
Rep Power
0
#include <iostream.h>
main()
{
int x,y,z;
cin>>x>>y;
z = 4.2*x+y*5/z – 0.52*x/y+z/x+y
cout<<z;
}

It's showing error on line 7 "statement missing"
4. No Profile Picture
I haz teh codez!
Devshed Frequenter (2500 - 2999 posts)

Join Date
Dec 2003
Posts
2,574
Rep Power
2342
And how do you end a statement in C++? You're doing it properly everywhere else...
5. No Profile Picture
bdb
Contributing User
Devshed Newbie (0 - 499 posts)

Join Date
Aug 2012
Posts
156
Rep Power
37
Also z is not initialized or assigned a value before being used.
6. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Nov 2012
Posts
3
Rep Power
0
Look at this

#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;
}
Still statement missing, will you help what to do?

• ptr2void disagrees : Pay attention to what people are telling you.
7. No Profile Picture
bdb
Contributing User
Devshed Newbie (0 - 499 posts)

Join Date
Aug 2012
Posts
156
Rep Power
37
pay attention to semicolons
8. As they keep telling you, pay attention to semicolons and to how you end statements in C++.

Also, from your problem statement, pay attention to grouping symbols, which is what parentheses are. Grouping symbols appear in your problem statement, but not in your attempts to code it.