Source Code



Membuat program bilangan n prima

  • Sulaeman Susanto
  • Aug 20' 13
  • C++
  • 71
  • 237
  • Indonesia

nich gan,, program untuk bilangan prima, menghasilkan bilangan prima

nich q kasih kodingnya,, cek dimari dha

#include <stdio.h>
#include <conio.h>
#include <iostream.h>

void main(){

int angka,i,n,j,sum;

cout<<"input n bil.prima pertama : ";cin>>n;

j=0;
angka=2;

while(j!=n)
{
sum=0;
for(i=1;i<=angka;i++)
{
if(angka%i==0)sum+=1;
}
if(sum==2)
{
cout<<angka<<" ";
j++;
}
angka+=1;
}

getch();
}
  • Tags :
comments powered by Disqus

Related Code

Piramida angka

Error 945 SQL Server 2008

Looping Leaning Figures

Remarks Script Browser

Creating Specification Page Number

Enter removing Signs In Field (string)

Deleting Log MSSQL Database

Restore and Backup Database MSSQL Using Query

SQL Database backup using Query

Piramida bintang rata kanan



Category