This web page requires JavaScript to be enabled.

JavaScript is an object-oriented computer programming language commonly used to create interactive effects within web browsers.

How to enable JavaScript?

In ra các số nguyên tố trong phạm vi N

10cth1-2 December 27, 2011 0

[codes=c]#include <stdio.h>
#include <conio.h>

int ktnt (int a)
{
  if(a<2) return 0;
  for(int i=2;i<a;i++)
    if(a%i==0)  return 0;
  return 1;
}

int main()
{
  int n;
  printf("nhap n: ");
  scanf("%d",&n);
  printf("cac so nguyen to trong khoang 1-> %d la:\n",n);
  int tam=0;
  while(tam<n)
  {
    if(ktnt(tam)==1)
      printf("%4d",tam);
      tam++;
  }
getch();
}[/codes]


Last modified on March 31st, 2021 at 1:10 am

Nam Le
lequocnam



0 responds

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.