Skip to content

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.

Notifications You must be signed in to change notification settings

devmittal-ctrl/creating_simple_calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

// 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; }

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

No packages published