For While Do

  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View For While Do as PDF for free.

More details

  • Words: 239
  • Pages: 7
# include <stdio.h> # include # include main() { char kd_susu,*jns_susu,*jns_ukuran,lagi; int jml_beli,kd_ukuran; double harga,bayar; //input mulai: cout<<"Input Kode Susu [A..C] =";cin>>kd_susu; cout<<"Input Kode Ukuran [1..3] =";cin>>kd_ukuran;

switch(kd_susu) { case 'a':case 'A': jns_susu="Dancow"; if(kd_ukuran==1) { strcmp(jns_ukuran,"Besar"); harga=25000; } Jenis else Susu if(kd_ukuran==2) Dancow { jns_ukuran="Sedang"; harga=20000; Bendera } else SGM { jns_ukuran="Kecil"; harga=15000; } break;

Beasr

Sedang

Kecil

25000

20000

15000

20000

17500

13000

22000

18000

16000

default: jns_susu="-"; jns_ukuran="-"; } //output cout<<"Maka Kode Susu="<
# include <stdio.h> # include # include main() { int a; int w; int g; //untuk Increase //for(a=1;a<=10;++a) //untuk Decrease //for(a=10;a>=1;a--) //untuk Operator for (a=1;a<=10;a+=3) //untuk warna Text /*for(w=1;w<17;++w )

gotoxy(w,w);textcolor(w); cout<<endl; cprintf("Maka warna ke =%d",w); } */ //untuk warna background /*for(g=0;g<20;g++) { textattr(g+((g+1)<<4)); cprintf("Maka background warna \r\n"); } */ //output decrease cout<
# include <stdio.h rel="nofollow"> # include # include main() { int i,j; for (i=1;i<=5;i++) { cout<<endl; for(j=i;j<=5;j++) cout<<<" "; } getch(); }

# include <stdio.h> # include # include main() { int bil=1; do { cout<
# include <stdio.h> # include # include main() { int bil=1; while (bil<=10) { cout<

Related Documents

For While Do
April 2020 15
Do-while
November 2019 32
Do While
June 2020 16
While
November 2019 30