Q1.Write algorithm for the following problems.
1. To add two numbers.
2. To find out if a number is even or odd.
Answers
Answer:
1. To add two numbers.
Algorithm:
Step 1. Initialize sum = 0
Step 2. Enter the values of a and b
Step 3. Add a and b and store the result in sum.
Step 4. Print the value of sum.
Step 5. End.
2. To find out if a number is even or odd.
Algorithm:
Step 1. Enter rem = 0
Step 2. Enter the value of num.
Step 3. Put rem = num%2
Step 4. If (rem = 0) is true, display number is an even number.
Step 5. If (rem = 0) is false display number is an odd number.
Step-by-step explanation:
Answer: 1) 2y + 3z = 5
2) x + z = 4
3) 3x - 2y = 7
Step-by-step explanation:
To find that equation of plane,
We need to find a point P which lies on the plane and a another vector which is perpendicular to the required plane.
Equation of plane passing through a point a and perpendicular to vector n is given by,
Case: 1 Equation of plane Parallel to x-axis
If the plane is parallel to x-axis then Normal of the plane should be perpendicular to x - axis.
Let a unit vector
Now that normal of the plane will be such that, which is perpendicular to both
and
We can say that,
Now,
Required Equation of Plane will be,
This is the required equation of the plane which is parallel to x-axis and passing through the points (3,1,1) and (1,-2,3).
Case: 2 Equation of plane Parallel to y-axis
If the plane is parallel to y-axis then Normal of the plane should be perpendicular to y - axis.
Let a unit vector
Now that normal of the plane will be such that, which is perpendicular to both \vec{PQ}
PQ
and
We can say that,
Now,
Required Equation of Plane will be,
This is the required equation of the plane which is parallel to y-axis and passing through the points (3,1,1) and (1,-2,3).
Case: 3 Equation of plane Parallel to z-axis
If the plane is parallel to x-axis then Normal of the plane should be perpendicular to z - axis.
Let a unit vector
Now that normal of the plane will be such that, which is perpendicular to both
and
We can say that,
Now,
Required Equation of Plane will be,