Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
144 views
in Computer by (43.6k points)
closed by

(a) Explain the following with reference to ‘C’ language:

(i) Data Type
(ii) Variables.

(b) What are the various arithmetic operators available in ‘C’ language? Explain with example.

1 Answer

+1 vote
by (43.1k points)
selected by
 
Best answer

(a) (i) Data Type: A data type decides the amount of memory to be allocated to a variable to store a particular type of data. To allocate memory for a particular piece of data, we have to declare a variable of a particular data type. The variable declaration means that some memory is allocated and that portion of memory will be referred to by the variable name.
Data types, which are commonly used in programming tools can be classified as :

  • Numeric: Stores numeric value.
  • Alpha Numeric: Stores descriptive information.
  • A numeric data type is called int: Similarly, an alpha-numeric data type is named char in C.

(ii) Variables: A variable is a name that represents a number or a string. Each numeric variable must consist of a letter or a letter followed by an integer. All variables that are to be used in the program must be declared prior to its use. Declaring a variable means defining a name and a data type of a variable. Every variable declaration is terminated by a semicolon. Variable names must begin with an alphabet. The first character may be followed by a sequence of letters or digits and can also include the special character ‘Underscore’.

(b) Arithmetical Operators: Operators that perform mathematical operations are called Arithmetical operators. These operators form a mathematical expression using operands along- with. There are five types of arithmetical operands available in C++ which are as follows:

(i) Add (+): To perform addition of operands. These operands can either be literal, identifier or combination of both.
e.g.:
a + b
2 + 2
x + 2

(ii) Subtract (-): In order to perform subtraction, operands can be literal, identifier or combination of both.
e.g.:
x – y
15 – 5
A – 10

(iii) Multiply (*): This operator performs multiplication on operands.
e.g.:
y * z
15 * 32
A * 25

(iv) Divide (/): It is used to perform division of the two operands.
e.g.
A/B
25/5
X/2

(v) Exponentiation (%): It is a modulus operator and returns the remainder of the division. A / operator returns the quotient after the division of operands and a modulus operator returns the remainder after division.
e.g.
10 % 3
X % 2

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...