forked from gouravthakur39/beginners-C-program-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gouravthakur39#151 from goelhr/patch-2
Update BasicArithmatic.c
- Loading branch information
Showing
1 changed file
with
16 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
// A simple arithmetic operation on two integers | ||
|
||
#include<stdio.h> | ||
int main() | ||
{ | ||
int number1,number2,addition,subtraction,multiplication,division,modulo; | ||
printf("Enter two numbers :\n"); | ||
scanf("%d%d",&number1,&number2); | ||
addition = number1+number2; | ||
subtraction = number1-number2; | ||
multiplication = number1*number2; | ||
division = number1/number2; | ||
modulo = number1%number2; | ||
printf("Addition of number 1 and number 2 : %d\n",addition); | ||
printf("Subtraction of number 1 and number 2 : %d\n",subtraction); | ||
printf("Multiplication of number 1 and number 2 : %d\n",multiplication); | ||
printf("Division of number 1 and number 2 : %d\n",division); | ||
printf("Modulo of number 1 and number 2 : %d\n",modulo); | ||
return 0; | ||
|
||
int main() { | ||
int number1, number2, addition, subtraction, multiplication, division, modulo; | ||
printf("Enter two numbers :\n"); | ||
scanf("%d%d", & number1, & number2); | ||
addition = number1 + number2; | ||
subtraction = number1 - number2; | ||
multiplication = number1 * number2; | ||
division = number1 / number2; | ||
modulo = number1 % number2; | ||
printf("Addition of number 1 and number 2 : %d\n", addition); | ||
printf("Subtraction of number 1 and number 2 : %d\n", subtraction); | ||
printf("Multiplication of number 1 and number 2 : %d\n", multiplication); | ||
printf("Division of number 1 and number 2 : %d\n", division); | ||
printf("Modulo of number 1 and number 2 : %d\n", modulo); | ||
return 0; | ||
|
||
} |