Ajay Chaudhary Classes Being Brilliant Computer Test 1 - Basic and Conditional Programming

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Ajay Chaudhary Classes

Being Brilliant
Computer Test 1 – Basic and Conditional Programming.

Question 1
A shop will give discount of 10% if the cost of purchased quantity is more
than 100.
Ask user for quantity required and rate of One Item.
Print the total cost for the user.
Sample Input:
Enter the quantity.
110
Enter rate.
50
The total cost is Rs. 4950.
Question 2
A school has following rules for grading system:
a. Below 25 : F
b. 25 to 45 : E
c. 45 to 50 : D
d. 50 to 60 : C
e. 60 to 80 : B
f. Above 80 : A
Ask user to enter the marks and print the corresponding grade.
Sample Input:
Enter the Marks.
77
The grade is B
Question 3
Write a program to print absolute value of a number entered by user.
Sample Input 1:
Enter the number.
-5
The absolute value of -5 is 5
Sample Input 2:
Enter the number.
6
The absolute value of 6 is 6
Question 4
Write a program to check if a number is Niven Number or not.
A number is called Niven if it is divisible by 9 and ends in 9.
Sample Input 1:
Enter the number.
99
The given number is a Niven Number.

END

You might also like