Malem sobat, Happy Idul Adha :)
kali ini saya share contoh code c++ tentang perulangan.
cekidot :D
#include<iostream.h>
#include<conio.h>
main()
{
int a, b, c;
cout<<"Masukkan Nilai Deret ";cin>>a;
for(b=1; b<=a; b++)
{
for(c=1; c<=b; c++)
{
cout<<"#";
}
cout<<" "<<endl;
}
getch();
}
#include<conio.h>
main()
{
int a, b, c;
cout<<"Masukkan Nilai Deret ";cin>>a;
for(b=1; b<=a; b++)
{
for(c=1; c<=b; c++)
{
cout<<"#";
}
cout<<" "<<endl;
}
getch();
}
hasilnya:
No comments:
Post a Comment