C Programming

Simple Examples   Problems and Solutions  

Problems and Solutions

  1. Write a program to read in a list of non-zero integers. The user inputs a zero to indicate end of input. The program then prints the average of all the numbers and the difference between the largest number and the smallest number entered.

    Solution
  2. Write a prgram that prints out a checkerboard design with #'s and _'s that looks like:
                 #_#_#_#_#_
                 _#_#_#_#_#
                 #_#_#_#_#_
                 _#_#_#_#_#
                 #_#_#_#_#_
    
    Your program should accept a positive integer as input and print a checkerboard with that many lines and that many pairs of #_'s

    Solution


Some Simple Programs

do/while loop finds a square    Wieght and Height    Celcius to Farenheit    Simple Program using #DEFINE    Very simple program using math operators    The Same    This program changes farenheit to celsius    Dumb Program    Very basic input & output program    Square Root    Basic input/output    Calculates Sales Tax    Math functions    Weekly Salary    Grade Calculation    Profit and Loss    Salary and Bonus    Bank Interest    Calculates Pay based on an hourly wage and takes out tax    Simple input/output   



External Links and Resources

C Tutorial(HowStuffWorks.com)
A Simple Factorial Program