DAY08
Wednesday, 30 May 2012
Today we will concentrate on the for loop.
-
factorial.c,
a function (not a whole program!) which computes the factorial of an
integer n, returning the value as a double.
-
p5.1.c, Calculating the eighth triangular number
-
p5.2.c, Calculating the 200th triangular number
-
p5.3.c, Generating a table of triangular numbers
-
p5.4.c, Asking the user for input using scanf()
-
p5.5.c, Using nested for() loops
-
prime_loops.c, uses nested loops to compute
and display the factors of each number from 2 to n.
-
prime_loops2.c, uses nested loops to compute
prime numbers; since we don't officially know about IF statements, the
program doesn't use any of those. What's really strange is that the inner
loop is empty. Can you explain how it works?
-
scanf_demo.c, demonstrates how the scanf(format,address)
function can be used to read data from the user.
-
taylor.c,
a program which estimates the value of exp(x) using Taylor series.
It needs "factorial.c" to work.
Last revised on 30 May 2012.