Here is calculator:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <math.h>
int main(void) {
int a,b,c,g;
long double d,e;
printf("Chose Yourself\n1. Addition\n2.Subtraction\n3.Multiplication\n4.Division\n5.Factorial\n6.Square\n7.Square root\n");
scanf("%d",&a);
if(a==1)
{
printf("Give two numbers\n");
scanf("%d%d",&b,&c);
g=b+c;
printf("Your answer is %d",g);
}
if(a==2)
{
printf("Give two numbers\n");
scanf("%d%d",&b,&c);
g=b-c;
printf("Your answer is %d",g);
}
if(a==3)
{
printf("Give two numbers\n");
scanf("%d%d",&b,&c);
g=b*c;
printf("Your answer is %d",g);
}
if(a==4)
{
printf("Give two numbers\n");
scanf("%d%d",&b,&c);
g=b/c;
printf("Your answer is %d",g);
}
if(a==5)
{
printf("Give a number\n");
scanf("%d",&b);
while(b!=0)
{
d=d*b;
b--;
}
printf("Your answer is %Lf",d);
}
if(a==6)
{
printf("Give a number\n");
scanf("%d",&b);
e=b*b;
printf("Your answer is %Lf",e);
}
if(a==7)
{
printf("Give a number\n");
scanf("%d",&b);
g=pow(b,0.5);
printf("Your answer is %d",g);
}
return 0;
}
Happy coding!