UVA Solution 474 – Heads _ Tails Probability – Solution in C

UVA Onilne Judge Solution UVA-Volume 4

UVA Solution 474 – Heads _ Tails Probability- Volume 4

UVA Online Judge Solution 474 – Heads _ Tails Probability| Volume 4
UVA Problem Link – 474 – Heads _ Tails Probability

Problem Name: 474 – Heads _ Tails Probability solution
Problem Number : UVA – 474 – Heads _ Tails Probability solution
Online Judge : UVA Online Judge Solution
Volume: 4
Solution Language : C

UVA Online Judge Solution, UVA OJ Solution list, UVA Problems Solution, UVA solver, UVA all problem solution list

UVA Solution 474 – Heads _ Tails Probability Code in C:

#include <stdio.h>
#include <math.h>
int main() {
int
n;
while
(scanf("%d", &n) == 1) {
if
(n == 6) {
puts("2^-6 = 1.562e-2");
continue
;
}

int
b = (int)floor(log10(2)*(-n));
printf("2^-%d = %.3lfe%dn", n, pow(10, log10(2)*(-n)-b), b);
}

return
0;
}

Tags: UVA Online Judge Solution, UVA OJ Solution list, UVA Problems Solution, UVA solver, UVA all problem solution list, UVA Heads _ Tails Probability code in C, UVA 474 – Heads _ Tails Probability code in C++, UVA 474 solution in C, UVA 474 – Heads _ Tails Probabilitysolution

Leave a Reply

Your email address will not be published.