// creating a simle calculator for basic arithmatics operation #include <stdio.h> #include<math.h> int main(){ // making simple calculator int n; float n1,n2,result; printf("now enter first numbers "); scanf("%f",&n1); printf("now enter second numbers "); scanf("%f",&n2); printf("Firstly enter the task you have to do "); printf("\n Press numbers according to following output:\n"); printf("addition (1), substraction (2), division (3), multiplication (4) " ); scanf("%d ",&n); if(n==1){ result = n1+n2; printf("you choose additon\n "); printf("%f",result); } else if(n==2){ result = n1-n2; printf("you choose substraction \n "); printf("%f",result); } else if(n==3){ printf("you choose divison\n"); if(n2==0){ printf("undertermined number"); } else{ result=n1/n2; printf("%f",result); } } else{ result = n1*n2; printf("you choose amultiplication\n "); printf("%f",result); } return 0; }
-
Notifications
You must be signed in to change notification settings - Fork 0
a simple calculator means that allows user to perform All the simple arithmetic operations like addition multiplication division and subtraction. The project can be made by basic knowledge of C.
devmittal-ctrl/creating_simple_calculator
About
a simple calculator means that allows user to perform All the simple arithmetic operations like addition multiplication division and subtraction. The project can be made by basic knowledge of C.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published