Raptor Questions Answers
Raptor Questions Answers
Write a program to accept two integers and check whether they are equal or not.
Test Data : 15 15
Expected Output :
Number1 and Number2 are equal
Question - 2
Accept three values from a user : num1, num2, and num3.
Return the largest of these three numbers.
Question - 3
Write a program to check whether a given number is positive,negative or 0.
Test Data : 15
Expected Output :
15 is a positive number
Question - 4
Write a program to find whether a given year is a leap year or not.
Test Data : 2016
Expected Output :
2016 is a leap year.
Question - 5
Write a program to read the value of an integer m and display the value of n is 1 when m is
larger than 0, 0 when m is 0 and -1 when m is less than 0.
Test Data : -5
Expected Output :
The value of n = -1
Question - 6
Write a program to accept a coordinate point in an XY coordinate system and determine in
which quadrant the coordinate point lies.
Test Data : 7 9
Expected Output :
The coordinate point (7,9) lies in the First quadrant.
Question - 7
Write a program to read temperature in centigrade and display a suitable message according to
the temperature state below:
Temp < 0 then Freezing weather
Temp 0-10 then Very Cold weather
Temp 10-20 then Cold weather
Temp 20-30 then Normal in Temp
Temp 30-40 then Its Hot
Temp >=40 then Its Very Hot
Test Data :
42
Expected Output :
It's very hot.
Question - 8
Write a program to check whether a triangle can be formed with the given values for the angles.
Test Data :
40 55 65
Expected Output :
The triangle is not valid.
Question - 9
Write a program to display the multiplication table for a given integer.
Test Data :
Input the number (Table to be calculated) : 15
Expected Output :
15 X 1 = 15
...
...
15 X 10 = 150
Question - 10
Write a program to check whether a given number is an Armstrong number or not.
Test Data :
Input a number: 153
Expected Output :
153 is an Armstrong number
Question - 11
Write a program to check whether a given number is a 'Perfect' number or not.
Test Data :
Input the number : 56
Expected Output :
The positive divisor : 1 2 4 7 8 14 28
The sum of the divisor is : 64
So, the number is not perfect.
Question - 12
Write a program to determine whether a given number is prime or not.
Test Data :
Input a number: 13
Expected Output :
13 is a prime number.
Question - 13 Write a program to read any day number in integer and display the day name in
word format.
Test Data : 4
Expected Output : Thursday
Question - 14
Write a program to calculate profit and loss on a transaction.
Test Data :
500 700
Expected Output :
You can booked your profit amount : 200
Ans: