Knowledge Walls
Venkatesan
Hyderabad, Andhra Pradesh, India
Passcode:
# Preprocessor [cont'd]
Introduction [cont'd]
Input Output Functions [cont'd]
Structures and Unions [cont'd]
Arithmetic Operators in Operators of Programming in C
1103 Views
Arithmetic operators 
Arithmetic operators are used to perform basic arithmetic operations. Addition, subtraction, multiplication, division and modules division.
Operators and meaning 
Operators Meanings
+ Adding two values
- Subtraction
* Multiplication
/ Division return quotient value
% Modules operator performs division returning remainder value
Program
#include
void main(){
   int num1 = 16;
   int num2 = 2;
   int add,sub,mul,divv,modu;
   add = num1 + num2;
   sub = num1 - num2;
   mul = num1 * num2;
   divv = num1 / num2;
   modu = num1 % num2;
   printf("Sum=%d\n",add);
   printf("Sub=%d\n",sub);
   printf("Mul=%d\n",mul);
   printf("Div=%d\n",divv);
   printf("Mod=%d",mod);
}
Output 
Sum=18
Sub=14
Mul=32
Div=8
Mod=0
Next Topics
Next lessons of current book.
Input Output Functions of Programming in C
Input Output Functions of Programming in C
Input Output Functions of Programming in C
Input Output Functions of Programming in C
Best Lessons of "Programming in C"
Top lessons which are viewed more times.
Input Output Functions of Programming in C
Structures and Unions of Programming in C
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details