-->

program to get value of expression y raised to power of x

// program to get value of xy
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float x,y;
float result;
printf(“enter x and y\n”);
scanf(“%f%f”,&x,&y);
result=pow(x,y); //pow() function exists inside math.h
printf(“the result is=%f\n”,result);
getch();
}


note: similarly you can get others' value.

program to get 'n' th power of expression

// program to get 'n' th power of given expression
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float a,b,n;
float result;
printf(“enter a and b\n”);
scanf(“%f%f”,&a,&b);
printf("enter value of 'n'\n");
scanf("%f",&n);
result=pow((a+b),n); //pow() function exists inside math.h
printf(“the result is=%f\n”,result);
getch();
}


note: this program gives you/us value of
(a+b)2 or (a+b)3 or any other.

program to get sum of three nos.



// program to get sum of three nos
#include<stdio.h>
#include<conio.h>
void main()
{
float a,b,c;
float sum;
printf(“enter nos. for a,b and c\n”);
scanf(“%f%f%f”,&a,&b,&c);
sum=a+b+c;
printf(“the sum is=%f\n”,sum);
getch();
}