cara menampilkan bilangan prima dengan do while di dev c++
berikut ini cara menampilkan bilangan prima dengan do while di dev c++, IDE yang saya gunakan adalah DEV C++. untuk kodingan nya bisa kalian copy paste,tapi sebaiknya jngan copy paste,ketik satu-satu secara manual untuk memahami alur kodingan nya. saya berharap kalian bisa memahaminya,semoga bermanfaat. maaf kalau acak-acakan.
#include<stdio.h>#include<conio.h>
main(){ int a,b,n,m,i,j; b=0; printf("bilangan prima dari: "); scanf("%d",&n); printf("sampai: "); scanf("%d",&m); i=n; do { a=0; i++; j=1;
do { if(i%j==0) a++; j++; } while(j<=i); if (a==2){ b=b+i; printf("%d\n",i); } } while(i<=m); getch();}outputnya:
Related Posts :
OPPO A3s Unboxing and First ImpressionsOPPO recently made the A3s official in the Philippines. It's an intriguing smartphone packed with premium looking design, big display with n… Read More...
Shopee Super Gadget Zone Sale include Samsung, Xiaomi, and moreShopee is holding their Super Gadget Zone Sale with big tech brands including Samsung, Xiaomi, JBL, Philips, Transcend, ASUS and Republic of… Read More...
PH ride-sharing industry needs help, Grab urges LTFRB to increase cap on TNVS unitsGiven the unreliable service of the Metro Rail Transit Line 3 (MRT-3) and the unending traffic not only in EDSA but also across Manila, Fili… Read More...
Meet Baseus 1+1 Wireless Charge Backpack Power Bank, Magnetic DuoOne of the products under Baseus' #gowireless series is the 1+1 Wireless Charge Backpack Power Bank.Baseus 1+1 Wireless Charge Backpack Powe… Read More...
Vivo Philippines teased that a new device is coming! What could it be?On Facebook, Vivo Philippines just teased that something is "arriving soon" in our country. What could it be?Vivo PH teaser imageBased … Read More...
0 Response to "cara menampilkan bilangan prima dengan do while di dev c++"
Post a Comment