Arithmetic Operators in C Language

Arithmetic Operators in C Language:

(1) Arithmetic Operators are used for calculation purpose

(2) Sample C language code and its output, as shown:

Arithmetic Operators in C Language Sample Code
#include <stdio.h>
#include <conio.h>
// Arithmetics Operators in C Language
int main()
{
  int x;
  int y;
  x = 10;
  y = 2;
  printf(“Value of Addition is: %d\n”, x+y);
  printf(“Value of Subtraction is: %d\n”, x-y);
  printf(“Value of Multiplication is: %d\n”, x*y);
  printf(“Value of Division is: %d\n”,x/y );
  printf(“Value of Modulus is: %d\n”, x%y);
  printf(“Value of Increment is: %d\n”,++x);
  printf(“Value of Decrement is: %d\n”,–y );
 
  getch();
  return 0;
}

(3) After that go to the “Build” menu and select the “Build” option for publishing the code as shown.

Click on Build Option for Arithmetic Operators in C Language

(4) After building the code, press the “Run” button, as shown.

Click on Run for Arithmetic Operators in C Language

(5) After pressing the “run” button, the output screen is opened, as shown.

output screen is opened for Arithmetic Operators in C Language
Arithmetic OperatorsDescription
+Addition
Subtraction
*Multiplication
/Division
%Modulus
++Increment
Decrement

How to get Data from SQL View in Excel Sheet
Take Database Backup via SQL Query in SQL Server
Use of ASCII function in SQL
Use of CHARINDEX Function in SQL
Getting Started with AL– Microsoft Docs

Leave a Reply