top of page

Calculator Code Of "C" Language

In This Blog Title I Will Be Giving The Code Of How To Create A Calculator By Using C Language

ree

The Compiler While Making This Program Is Dec C++


C Language Facts


It was developed & released around the year 1972.


One of the most interesting facts is that It was developed at Bell Laboratories in 1972 by Dennis Ritchie.





The Code:-


#include<stdio.h> main(){ int n1,n2,sum; printf("Welcome To The Calculator \n"); printf("This Is For Addition \n"); printf("Enter Number 1 \n"); scanf("%d",&n1); printf("Enter Number 2 \n"); scanf("%d",&n2); sum=n1+n2; printf("The Sum Of The The Two number you Entered Is %d \n",sum); sub(); mul(); div(); } sub(){ int s1,s2,sub; printf("This Is For Subtraction\n"); printf("Enter Number 1 \n"); scanf("%d",&s1); printf("Enter Number 2 \n"); scanf("%d",&s2); sub=s1-s2; printf("The Difference Of The The Two number you Entered Is %d \n",sub); } mul(){ int m1,m2,mul; printf("This Is For Multiplication \n"); printf("Enter Number 1 \n"); scanf("%d",&m1); printf("Enter Number 2 \n"); scanf("%d",&m2); mul=m1*m2; printf("The Product Of The The Two number you Entered Is %d \n",mul); } div(){ int d1,d2,div; printf("This Is For Division\n"); printf("Enter Number 1 \n"); scanf("%d",&d1); printf("Enter Number 2 \n"); scanf("%d",&d2); div=d1/d2; printf("Your Reslut Is %d",div);


}

ree

 
 
 

Comments


©2020 by Leisure Tech Time.

bottom of page