Facebook
From Subtle Plover, 5 Years ago, written in Plain Text.
This paste is a reply to Untitled from Emerald Dove - go back
Embed
Viewing differences between Untitled and Re: Untitled
#include 
#include 
using namespace std;

int main()
{
    int p=1,d,licz=0,l,o,n,pierwsza,zlozona;
    cout << "Sprawdzanie czy liczba jest pierwsza!" << endl;
    cout << "Podaj liczbe"<     cin >>l;
    for (o=2;o     {

    if (l!=1&&l!=2)
    {
       for (d=2;d<=sqrt(l);d++)
    {
        if (l%d==0)

    {
        p=0;
    }
    }

    }

    if (p==0) n=zlozona;
    else n=pierwsza;
    if (n==pierwsza) cout <<"2"<     }

    return 0;
}