Program example cont.
If we execute the program sqrroot.c and enter 2 when prompted, here is what appears on the screen:
The square root of x and x raised
to the x power will be computed.
---
Input x: 2
x = 2.000000000000000e+000
sqrt(x) = 1.414213562373095e+000
pow(x, x) = 4.000000000000000e+000
Input x:
- Question: How can you quit the program?
/* program to read items, and compute their average p.7 of text*/
….. while (scanf( “%lf”, &ThisItem) == 1)
{ ItemRead++;
Sum += ThisItem;} ..........