Mulai Baca x S=x%2 S=0 “Genap” Selesai Yes No XSS=0?Output main() { int x,s; cin>>x; s=x%2; if(s==0) { cout<<“Genap”; } else { cout<<“Gasal”; } “Gasal”
Mulai Baca x XSS=0?Output X=5 5
Mulai Baca x S=x%2 X=5 XSS=0?Output 5 1
Mulai Baca x S=x%2 S=0 X=5 XSS=0?Output 5 1 No
Mulai Baca x S=x%2 S=0 Selesai Yes No “Gasal” X=5 XSS=0?Output 5 1 No Gasal
Mulai Baca x X=4 XSS=0?Output 4
Mulai Baca x S=x%2 X=4 XSS=0?Output 4 0
Mulai Baca x S=x%2 S=0 X=4 XSS=0?Output 4 0 Yes
Mulai Baca x S=x%2 S=0 “Genap” Selesai Yes X=4 XSS=0?Output 4 0 Yes Genap