You are on page 1of 9

Assignment – 3

Check the given number is even or odd


Check the given number is positive or negative
Check the given number is positive or zero or negative
Write a C program to check whether a number is divisible by 5 and 11 or not
Write a C program to check whether a year is leap year or not.
Write a C program to input angles of a triangle and check whether triangle is
valid or not.
Write a C program to input all sides of a triangle and check whether triangle is
valid or not
Write a C program to check whether the triangle is equilateral, isosceles or scalene
triangle
Viva Questions
1.Arithmetic operators with example
Arithmetic Operator is used to performing mathematical operations such as addition,
subtraction, multiplication, division, modulus, etc., on the given operands.

example: 5 + 3 = 8, 5 - 3 = 2, 2 * 4 = 8, etc.

2.Binary arithmetic operators

Binary operators act upon two operands to produce a new value. Such, operators can be
classified into different categories.
Eg: a+b, a-b etc

3.Unary arithmetic operators

Operator that takes a single operand/argument and performs an operation is called unary
operator. A unary operation performs an operation with only one operand.
Eg: a++

4.Relational operators and examples

Relational operators are used to compare two values in C language. It checks the relationship
between two values. If relation is true, it returns 1. However, if the relation is false, it returns
0.
Eg: ==, <,>, <=,>=, != etc.

5.Logical operators

These operators are used to perform logical operations on the given expressions. There are 3
logical operators in C language. They are, logical AND (&&), logical OR (||) and logical
NOT (!).

You might also like