Beruflich Dokumente
Kultur Dokumente
Control Statements
Lecture 8
IF
If you can keep your head when all about you
Are losing theirs and blaming it on you,
If you can trust yourself when all men doubt you
But make allowance for their doubting too,
If you can wait and not be tired by waiting,
Or being lied about, don't deal in lies,
Or being hated, don't give way to hating,
And yet don't look too good, nor talk too wise:
THEN
Yours is the Earth and everything that's in it,
And--which is more--you'll be a Man, my son!
--Rudyard Kipling
else statement ;
#include <stdio.h>
int main ( )
{
int a = 1, b = 2, c ;
if (a > b) c = a;
else c = b;
}
Winter Quarter The Ohio State University Lect 8 P. 6
Gateway Engineering Education Coalition
Engineering H192 - Computer Programming
#include <stdio.h>
int main ( )
{
int a = 1, b = 2, c ;
if (a > b)
c=a;
else
c=b;
}
#include <stdio.h>
int main ( )
{
int score ;
printf ("enter your test score >") ;
scanf ("%d", &score) ;
Winter Quarter The Ohio State University Lect 8 P. 13
Gateway Engineering Education Coalition
Engineering H192 - Computer Programming