Jump to content

Eroare Programel Code::blocks In C++


Courage

Recommended Posts

  • Moderators

Salut.

 

Am instalat Code::Blocks, dupa care: Console Aplication > am bagat numele > C++ > GNU Compiler. 

 

Am scris programelul in main.cpp asa:

 


#include <iostream>

using namespace std;

int main()
{
    int a,b,i,prim,d,k=0;
    f>>a>>b;
    for(i=a;i<=b;i++)
    {
        prim=0;
	    for(d=2;d<=i/2;d++)
            {
                if(i%d==0)
                prim=1;
            }
            if(prim==0)
            {
            g<<i<<" ";
		    k++;
            }
    }
    if(k==0)
    g<<"Nu este niciun numar prim in intervalul ["<<a<<","<<b<<"].";
    return 0;
}
 

Am dat Save > Build & Run. Nicio eroare gasita, dar nu se inampla nimic :(.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.