1

3-D points- multiply and increment (Id-2782)

Bonus Practice Sheet Winter 2018 [17-Mar-2018 to 7-Apr-2018]

Program ID- 2782

Given a point in three-dimensional space with x-coordinate, y-coordinate, z-coordinates,  Provide a function increment with one, two and three parameters to transform  the values of all the three coordinates. When the function with one parameter is called increment all the three , by same value .  When the function with two arguments is called multiply each coordinates by the sum  of the two parameters. when the function with three arguments is called, increment x-coordinate  by the value of first parameter, y-coordinate by the value of the second parameter and z-coordinate  by the value of the third parameter.

Input format:

Enter the coordinates of the point

X-coordinate

Y-coordinate

Z-coordinate

Enter the increment value for function with one parameter

Enter the values for the function with two parameters

Enter the  increment values for function with three parameters

Output format:

Display the coordinates of the point after calling function with one parameter

Display the coordinates of the point after calling function with two parameters

Display the coordinates of the point after calling function with three parameters

Code

Please Comment Working if the code worked to you

If you have other working codes please comment the codes enclosing with <pre> and </pre> 🙂

Example: <pre> Your Code </pre>

C++ Code 

The Above Codes are for reference only. It doesn't mean everyone to directly copy/paste those codes.

 

Click Here to Leave a Comment Below 1 comments
sohan - March 29, 2018

this is not working !!

error displayed:

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function

_start’:
(.text+0x20): undefined reference to 
main’
collect2: error: ld returned 1 exit status




1



0

Reply

Leave a Reply:

This site uses cookies and by using the site you are consenting to this.