Assignment 1
Assignment 1
Basics (variables)
1. Write a program to swap value of two variables without using third variable.
Note: don’t use a built-in function to swap the two numbers.
2. Write a program which accepts a character and display its next character
For Example if the user insert ’a’ your program should display ‘b’ (which is
the next character for ‘a’)
3. Write a program that accepts any integer from the user to find out its
absolute value.
Note: don’t use a built-in function. For Example if the user insert ’-1’ your
program should display ‘1’
4. If the ages of Anteneh, Ruta and Jemal are inputs from the user, write a
program to determine the youngest of the three.
For Example if the user insert ’23 43 12’ your program should display
‘Jemal is the Youngest’
5. A triangle is valid if the sum of all the three angles is equal to 180 degrees.
Write a program to check whether a triangle is valid or not, when the three
angles of the triangle are entered by the user.