Anda di halaman 1dari 1

COMPUTER SCIENCE (083)

Ass# 1 (Operators and Expressions)


1. Write a program to display the following message:
NAME: < your name>
CLASS: < Your class>
SECTION: < Your section>
MESSAGE: The professor said, Please dont sleep in the class.
2. Write a C++ program to input two numbers as N1 and N2, perform arithmetic operation (+, - ,
*, /) and display the results.
3. Write a program to accept the side of a square. Calculate and display its area and perimeter.
4. Write a program to accept the length and breadth of a rectangle. Calculate and display its area
and perimeter.
5. Write a program to accept radius of a circle. Calculate and display its area and circumference.
6. Write a program to accept three sides of a triangle and calculate its area using Herons
formula.
7. Write a program to accept temperature in Fahrenheit and display the corresponding
temperature in Celsius.
8. Write a program to accept time in minutes and display corresponding time in hours and
minutes. For example, if Input is 75 minutes, the output is 1 hour 15 minutes.
9. Write a program to swap (interchange the value) of two numbers using a third variable.
10. Write a program to swap two numbers without using the third variable.
11. Write a program to accept three nos. and display the greatest of the three using conditional
operator.
12. Write a program that will find out whether the given number is odd or even using
conditional operator.

Anda mungkin juga menyukai