This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Tampilkan postingan dengan label progam untuk mengetahui bilangan prima/bukan. Tampilkan semua postingan
Tampilkan postingan dengan label progam untuk mengetahui bilangan prima/bukan. Tampilkan semua postingan

Senin, 05 Maret 2012

progam untuk mengetahui bilangan prima/bukan

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

using namespace std;
      main()
      {
           
      int w,j,count=0;      
      cout<<"\nMasukkan Sebuah Angka : ";   
      cin>>w;
      for(j=2;j<=w/2;j++)
     
      {
         if(w%j==0)      
         count++;
       }
      
      if(count>0 || w<2)   
         cout<<w<<" Bukan Bilangan Prima\n";
      else cout<<w<<" Adalah Bilangan Prima\n";
        
    system("pause");
    return(0);
}

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More