Welcome !!

NICETECHVIDYA

Tutorials

Web Designs

You are welcome to Aptech Designers, designed by Pratik from Nepal.

Creativity is my passion. Logo describes your details about company.

Graphics Design needs vision to create yours unique digital concept.

Responsive and All Browser Compatible Dynamic Web Layouts our target.

Home Python C Language J A V A Our Courses
This WebSite is under Construction....

Friday 30 April 2021

Arithmetic Operators post 13

Arithmetic Operator in C programming


The Arithmetic operators are some of the C Programming Operator, which are used to perform arithmetic operations includes operators like Addition, Subtraction, Multiplication, Division and Modulus.All these Arithmetic operators in C are binary operators which means they operate on two operands.

ARITHMETIC OPERATORSOPERATIONEXAMPLE
+Addition10 + 2 = 12
Subtraction10 – 2 = 8
*Multiplication10 * 2 = 20
/Division10 / 2 = 5
%Modulus – It returns the remainder after the division10 % 2 = 0 (Here remainder is zero). If it is 10 % 3 then it will be 1.








 
 #include
 int main()
 {
 
 int first,second,add,sub,mul,div,mod;
 
 /* first =45
  second=60 */
 printf("Enter Two values::");
 sannf("%d%d",&first,&second);
 
 add=first+second;
 print("The addition is :: %d",add);
 
 add=first+second;
 print("The addition is :: %d",add);
 
 mul=first*second;
 print("The addition is :: %d",add);
 
 add=first+second;
 print("Division is :: %d",div);
 
  /* MODULUS */
  
 mod=first%second;
 print("The addition is :: %d",mod); 
  
return 0;

  }
  
 
Another Model

 

#include<stdio.h>
int main() 
int a,b,c;  float x;  printf("\nEnter 2 Nos : ");  scanf("%d%d",&a,&b);  c=a+b; printf("\nTotal : %d",c);  c=a-b; printf("\nDifference : %d",c); c=a*b; printf("\nMul : %d",c);  x=(float)a/(float)b;  printf("\nDiv : %0.2f",x);  c=a%b;  printf("\nMod : %d",c); return 0; 
}

Output Enter 2 Nos : 25 10 Total : 35 Difference : 15 Mul : 250 Div : 2.50 Mod :

0 comments:

Post a Comment