Write a program which takes as input two integers and displays the sum of all the integers that lie between those two numbers. E.g., if x is 4 and y is 8, the answer would be 18 and if x is 8 and y is 4, the answer would be 18.
Write a program which takes as input and integer and prints "prime number" if it is a prime number. Hint: Suppose the number is 7 - divide it by 2 then 3 then 4 then 5 then 6 - if in any division, the remainder is zero, that means the number is not a prime.
a) int x=10, y=20;cout<<x+++++y;
b) int x=10, y=20;cout<<x++-++y;
c) int x=10, y=20;cout<<++x+y++;
d) for(int x=0;x<10;x++)cout<<x;
e) for(int x=0, y=3; x<2*y; x++,y--)cout<<x;
Create two classes:
BaseClass
The Rectangle class should have two data fields-width and height of int types. The class should have display()method, to print the width and height of the rectangle separated by space.
DerivedClass
The RectangleArea class is derived from Rectangle class, i.e., it is the sub-class of Rectangle class. The class should have read_input() method, to read the values of width and height of the rectangle. The RectangleArea class should also override the display() method to print the area (width*height) of the rectangle.