You are on page 1of 7

Assignment-2

1.Adding two numbers

2.Subtracting two numbers

3.Multiplying two numbers


4.Dividing two numbers

5.Find remainder of two numbers


6.Sum of 5 numbers without loop

7.Find the area of a circle


8.Find the area of a cube

9.Find the area of a square


10.  Find the area of a rectangle

11.  Find the volume of a cube


Viva questions
1.What is a variable?
A variable is a named unit of data that is assigned a value. If the value is modified, the
name does not change.
2.What are the rules for defining variables?

o A variable can have alphabets, digits, and underscore.


o A variable name can start with the alphabet, and underscore only. It can't start with a
digit.
o No whitespace is allowed within the variable name.
o A variable name must not be any reserved word or keyword, e.g., int, float, etc.

3.What is data type?


A data type, in programming, is a classification that specifies which type of value a
variable has and what type of mathematical, relational or logical operations can be applied to
it without causing an error.

4.What is escape sequence?

In computer science, an escape sequence is a combination of characters that has a


meaning other than the literal characters contained therein; it is marked by one or more
preceding (and possibly terminating) characters.

5.Explain character set?

A character set refers to the composite number of different characters that are being
used and supported by a computer software and hardware. It consists of codes, bit pattern or
natural numbers used in defining some particular character. 

6.Define Identifiers?

Identifiers are names for entities such as variables, arrays, functions, structures, unions
and labels. An identifier can be composed only of uppercase, lowercase letters, underscore
and digits, but should start only with an alphabet or an underscore

You might also like