Write a program in python to calculate greatest common divisor of a number import math print("Greatest Common Divisor ") # prints 12 print("The gcd of 60 and 48 is : ", end="") print(math.gcd(60, 48)) # The gcd of 98 and 56 is : 14 # The gcd of 60 and 48 is : 12 ''' def hcf(a, b): if(b == 0): return a else: return hcf(b, a % b) a = 60 b = 48 # prints 12 print("The gcd of 60 and 48 is : ", end="") print(hcf(60, 48)) '''
In mathematics, a Cartesian coordinate system is a coordinate system that specifies each point uniquely in a plane by a set of numeric points. Cartesian Coordinates is represented by (x,y) . In mathematics, the polar coordinate system is a two-dimensional coordinate system in which each point on a plane is determined by a distance from a reference point known as radius and an angle from a reference direction known as theta or simply angle. Polar Coordinates system is represented by (r,θ) . For the negative value of r in polar coordinates, what to do? Watch the given below youtube video to cover it. https://www.youtube.com/watch?v=kNANYzuOUpA Fig: Polar Coordinates Check this website for more knowledge: https://openstax.org/books/calculus-volume-2/pages/7-3-polar-coordinates C++ PROGRAM : DEFINE TWO CLASSES POLAR AND RECTANGLE REPRESENT POINTS IN POLAR AND RECTANGULAR SYSTEM. USE SUITABLE MEMBER FUNCTIONS TO CONVERT FROM ONE SYSTEM TO ANOTHER...
SAME NAME IN CLASS METHOD AND CONSTRUCTOR, STATIC VARIABLE class Emp { String ename; int age; int sal; static int count=0; int empno; Emp() { } void Emp(String n, int a, int s) { count+=1; empno=count; ename=n; age=a; sal=s; } void show() { System.out.println("Emp_no: "+empno); System.out.println("Emp_name: "+ename); System.out.println("Emp_ag...
Comments
Post a Comment