Header file:
math.h
Synopsis:
double ldexp(double x, int exp);
Description:
Returns the value of x multiplied by 2 to the power of exp.
ldexp function C example:
#include<stdio.h>
#include<math.h>
int main() {
double x, res;
int n;
printf("Enter the value of x and n:");
scanf("%lf%d", &x, &n);
res = ldexp(x, n);
printf("%lf * 2 ^ %d = %lf\n", x, n, res);
return 0;
}
#include<math.h>
int main() {
double x, res;
int n;
printf("Enter the value of x and n:");
scanf("%lf%d", &x, &n);
res = ldexp(x, n);
printf("%lf * 2 ^ %d = %lf\n", x, n, res);
return 0;
}
Output:
jp@jp-VirtualBox:~/cpgms/math$ ./a.out
Enter the value of x and n:2 4
2.000000 * 2 ^ 4 = 32.000000
Enter the value of x and n:2 4
2.000000 * 2 ^ 4 = 32.000000
Do you need Finance? Are you looking for Finance? Are you looking for finance to enlarge your business? We help individuals and companies to obtain finance for business expanding and to setup a new business ranging any amount. Get finance at affordable interest rate of 3%, Do you need this finance for business and to clear your bills? Then send us an email now for more information contact us now via (financialserviceoffer876@gmail.com) whats-App +918929509036 Dr James Eric Finance Pvt Ltd Thanks
ReplyDelete