Created
September 13, 2018 14:43
-
-
Save LokeshKumarES/87f02d1fcdf63408752f6914486edd77 to your computer and use it in GitHub Desktop.
2-Write a C program to perform basic functionality of calculator
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
#include<stdio.h> | |
#include<conio.h> | |
void main() | |
{ | |
int a, b, add, sub, mul; | |
float div; | |
printf("Enter First Number: "); | |
scanf("%d",&a); | |
printf("Enter Second Number: "); | |
scanf("%d",&b); | |
add=a+b; | |
sub=a-b; | |
mul=a*b; | |
div=a/b; | |
printf("The addition of %d and %d is: %d\n", a, b, add); | |
printf("The subtraction of %d and %d is: %d\n", a, b, sub); | |
printf("The multiplication of %d and %d is: %d\n", a, b, mul); | |
printf("The division of %d and %d is: %f\n", a, b, div); | |
getch(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment