Pages

Hello there!

Powered by Blogger.

Monday, January 7, 2013

ARITHMETIC OPERATORS IN C


ARITHMETIC OPERATORS IN C WITH EXAMPLE

Different Arithmetic operators used c are shown in table.

Operatorfunction
*Multiplication
/Division
%Remainder
+Addition
-Subtraction

* operator is used give product of 2 numbers.

/ Operator gives Quotient after dividing Divisor and Dividend. Divisor should be nonzero number. 

% operator gives remainder after division of 2 numbers. % operator can be used only for integer data type.

+ operator gives sum of 2 numbers.

- operator used to subtract one number from another number. 

Note:-

# If both number are positive than answer will be in positive number.
# If either or both number are negative than answer will be either in positive or in negative, it is machine dependent.

Example:-

Program to find sum of 2 number.



Program to find product of 2 number.


Program to find subtract 2 number.


Program to find division 2 number.



Program to find remainder.



0 comments:

Post a Comment