Q1. Name the keyword which helps in writing code involves condition.
Q2. Write the syntax of simple if statement.
Q3. Is there any limit of statement that can appear under an if block.
Q4. Write a program to check whether a person is eligible for voting or not. (accept age from user)
Q5. Write a program to check whether a number entered by user is even or odd.
Q6. Write a program to check whether a number is divisible by 7 or not.
Q7. Write a program to display "Hello" if a number entered by user is a multiple of fie , otherwise print "Bye".
Q8. Write a program to calculate the electricity bill according to the following criteria :
unit price
First 100 units -----------no charge
Next 100 units ----------Rs 5 / unit
Next units ---------------Rs 10/unit
(For example if input unit is 350 than total bill amount is Rs2000)
Q9. Write a program to display the last digit of a number.
(hint : any number % 10 will retun the last digit)
Q10. Write a program to check whether the last digit of a number( entered by user ) is divisible by 3 or not.
No comments:
Post a Comment