Menampilkan Luping di dalam C++ disini saya akan mengaja anda cara Menampilkan Luping di dalam C++
#include <iostream.h>
#include <conio.h>
#include <math.h>
#include <string.h>
#include <stdio.h>
void main()
{
char mad ;
clrscr();
int c,b,a,kode;
mad= 'y';
while(mad=='y')
{
clrscr();
cout<<" 1. while "<<endl;
cout<<" 2. do while "<<endl;
cout<<" 3. for "<<endl;
cout<<"-------------------"<<endl;
cout<<" Pilih Kode (1/2/3) : ";cin>>kode;
switch (kode)
{
case 1:
cout<<" while "<<endl;
cout<<"============"<<endl;
c=10;
while (c <= 100)
{
cout<<c<<endl;
c=c+10;
}
break;
case 2:
cout<<" do while "<<endl;
cout<<"============="<<endl;
b=10;
do
{
cout<<b<<endl;
b=b+10;
}
while (b<=100);
break;
case 3:
cout<<" for "<<endl;
cout<<"======="<<endl;
for (a=10; a<=100;a=a+10)
{
cout<<a<<endl;
}
break;
default:
cout<<"Kode yang anda masukkan salah"<<endl;
break;
}//swicth
cout<<"\n\t\t INGIN INPUT LAGI? [Y/T] : "; cin>>mad;
}//while
}//void
Semoga bermampaat buat anda menampilkan Luping di C++
Langganan:
Posting Komentar (Atom)
0 Response to "Menampilkan Luping di C++"
Posting Komentar