Upload
skyyyeisthebest
View
215
Download
0
Embed Size (px)
Citation preview
7/25/2019 if434
1/5
T1-CS101 INTRODUCTION TO COMPUTING 1 2014
B. SIMPLE IF
1. A Program that will run if the value is lesser than 20
C!E
"in#lu$e%st$io.h&''hea$er
"in#lu$e%#onio.h&''hea$er
Main()''main fun#tion
*''terminal
Int a+''varia,le
Clrs#r()+''#lear s#reen
Printf(-inut the value/)+''$islas a string
S#anf(-3$45a)+''s#an formatte$
If (a%20)''se6uen#e statement
*''terminal
Printf(-7um,er 3$ is less than 84a)+''$islas a string
9''terminal
:et#h()+''suort the #onio
;
7/25/2019 if434
2/5
T1-CS101 INTRODUCTION TO COMPUTING 1 2014
2. Program to =ea$ 0+''varia,le
#lrs#r( )+''#lear s#reen
rintf(-E7#+
rintf (-BI::ES< F AB?E :I?E7
7/25/2019 if434
3/5
T1-CS101 INTRODUCTION TO COMPUTING 1 2014
9''terminal
;
7/25/2019 if434
4/5
T1-CS101 INTRODUCTION TO COMPUTING 1 2014
. )''se6uen#e statements
rintf(-Single $igit)+''$islas a string
if(n&)''se6uen#e statements
rintf(-7ot single $igit)+''$islas a string
get#h()+''suort a #onio
9''terminal
;
7/25/2019 if434
5/5
T1-CS101 INTRODUCTION TO COMPUTING 1 2014
Enter a num,er/127ot single $igit
. >GaG HH >>GAG HH >>GeG HH >>GEG HH >>GiG HH >>GIG
HH >>GoG HH >>GG HH >>GuG HH >>G;G)''se6uen#e statement
rintf(-It is ?owel)+''$islas string
get#h()+''suort a #onio
9''terminal
;