Lab - I
2. Write a program to enter two numbers through keyboard and find their sum.
3. Two numbers are input through the keyboard into two locations C and D. Write a
program to interchange the contents of C and D.
4. Any integer is input through the keyboard. Write a program to find out whether it is
an odd number or even number.
6. Temperature Conversions
7. A cashier has currency notes of denominations 10, 50 and 100. If the amount to be
withdrawn is input through the keyboard in tens, find the total number of currency
notes of each denomination the cashier will have to give to the withdrawer.
8. Write a program to determine whether the entered year is a leap year or not. (Hint:
Use the % (modulus) operator)
9. Write a recursive function to obtain the running sum of first n natural numbers.
Obtain the value of n from the user.
NIELIT, CALICUT
1
Internet of Things – Internship Program
if(color.equals("toggle"))
{
// perform action
}
NIELIT, CALICUT
2
Internet of Things – Internship Program
NIELIT, CALICUT
3