IHYPRESS PROGRAMMING
Tutorials and C programs with code and output for beginners
c programming
HOME | ASP | C | CSS | GNUPLOT | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
C > 05. Simple Functions
  1. The stars Function: a void Function Without Arguments
    A function that displays a line of stars on the screen.
  2. The stars2 Function: a void Function with One Argument
    A function that displays a line of stars of variable length depending on a numerical value.
  3. The stars2 Function Using a Prototype
    The same function as before but with a prototype declared at the top of the program.
  4. The factorial Function: One Argument, One Result
    A function that computes the factorial of an integer number.
  5. The bigger Function: Two Arguments, One Result
    A function that takes in two numbers and returns the largest value of the two.
  6. The Prime Numbers Function
    A function that returns 1 if a number is prime and 0 otherwise.
  7. A List of Prime Numbers
    A program displaying the list of all prime numbers between 1 and 1000. It uses the Prime Numbers function.
  8. Drawing a Stick figure
    A program that uses functions to display geometric stick figures.
  9. The print_rboxed Function
    Displays a real number in a box.
  10. The Circle Program (with Helper Fnctions)
    A program that asks the user for the diameter of a circle and prints out its circumference and area calling user-defined functions.
  11. The scale Function
    A function that multiplies its first argument by the power of 10 specified by its second argument.
COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland