Professional Documents
Culture Documents
Introduction to C Programming
Language
Intr. to C
Programmi
Intr. to C++
ng
Programmi
Structured
Program
Development in
ng
Syllabus
C Program
C Arrays
Control
C Functions
Intr. to C programming
3
Objectives:
Lecture #3
Objectives:
Lecture #3
Book:
C Language
7
Input
Output
Writing C Programs
A programmer uses a text editor to create or
file.
After a C source file has been created, the
A Simple C Program:
Printing a Line of Text
Escape sequence
Escape sequence
Escape sequence
Arithmetic in C
Example:
Example:
Example:
Example: Output
Examples:
Example-3: Write an algorithm in flowchart to
Examples:
Example-4: Write an algorithm in flowchart to
convert the
Fahrenheit.
temperature
from
Celsius
to
Examples:
Example-4: Write an algorithm in flowchart to
S= R H - D
Exercises:
Given the equation y = ax3 + 7, which of the
following, if any, are correct C statements for
this equation?
Exercises:
(Arithmetic) Write a program that asks the
user to enter two numbers, obtains them
from the user and prints their sum, product,
difference, quotient and remainder.
Exercises:
(Shapes with Asterisks) Write a program
that prints the following shapes with
asterisks.
Exercises:
(Table of Squares and Cubes) Using only
the techniques you learned in this lect.
write a program that calculates the squares and
cubes of the numbers from 0 to 10 and uses
tabs to print the following table of values:
Anatomy of a C Program
program header comment
preprocessor directives (if any)