#include<stdio.h>
int main(void)
{
int i,n;
double x,sum;
printf("Enter x,n:");
scanf("%lf%d",&x,&n);
sum=1;
for(i=1;i<=n;i++){
sum=sum*x;
}
printf("x^n=%.2f
",sum);
return 0;
}
#include<stdio.h>
int main(void)
{
double num1,num2;
char op;
printf("Type in an expression:");
scanf("%lf%c%lf",&num1,&op,&num2);
if(op=='+')
printf("=%.2f
",num1+num2);
else if(op=='-')
printf("=%.2f
",num1-num2);
else if(op=='*')
printf("=%.2f
",num1*num2);
else if(op=='/')
printf("=%.2f
",num1/num2);
else
printf("Unknown operator
");
return 0;
}