Beruflich Dokumente
Kultur Dokumente
C Programming Language
- Simple
- Robust
- Powerful
..
+1300042774
+1400593419
+1200274027
load basepay
add overpay
store grosspay
Hello World
#include <stdio.h>
/* function main begins program execution */
int main( void )
{
printf( "Welcome to C!\n" );
return 0; /* indicate that program ended successfully */
} /* end function main */
Hello World
#include <stdio.h>
int main()
{
printf("hello, world\n");
}
Hello World
#include <stdio.h>
/* function main begins program execution */
int main( void )
{
printf( "Welcome to C!\n" );
return 0; /* indicate that program ended successfully */
} /* end function main */
Escape Characters
\n
\t
\a
\\
\"
Hello World
\o
|\
/\
Memory Concepts
scanf( "%d", &integer1 ); /* read an integer */
Memory Concepts
scanf( "%d", &integer2 ); /* read an integer */
Memory Concepts
sum = integer1 + integer2; /* assign total to sum */
Arithmetic in C
Arithmetic in C
Control Structures
The if statement
exercise
A class of ten students took a quiz. The grades (integers in the range
0 to 100) for this
quiz are available to you. Determine the class average on the quiz.
exercise
The Fibonacci series
Different ways to
increment/decrement
int number;
number = number + 1;
number += 1;
++number;
number++;
exercise
A person invests $1000.00 in a savings account yielding 5%
interest. Assuming that
all interest is left on deposit in the account, calculate and
print the amount of money
in the account at the end of each year for 10 years. Use the
following formula for
determining these amounts:
a = p(1 + r)n
where
p is the original amount invested (i.e., the principal)
r is the annual interest rate
n is the number of years
a is the amount on deposit at the end of the nth year.
C : How To Program
Paul Deitel Harvey Deitel