当前位置:网站首页>Print prime numbers between 100 and 200 (C language)
Print prime numbers between 100 and 200 (C language)
2022-06-29 10:36:00 【Xihong Shiwang has many fish】
prime number : Prime numbers are defined as being greater than 1 Of the natural number , except 1 And there's no more than it itself Factor .( except 1 And itself, no integer can divide it by )
Programming ideas : Define two variables ,i and j, Make i by 100~200 Number between ,j Is the factor , use for Loop through modulo operations , The demo code is as follows
#include <stdio.h>
int main()
{
int i,j;
printf("100~200 The prime numbers between :");
// Traverse 100-200 Number of numbers , Judge i Is it a prime number
for(i=100;i<=200;i++)
{
// j It's from 2~i-1 The numerical
for(j=2;j<i;j++)
{
// Judge i model j Whether there is no remainder , remainder =0 said i Can be divided by a number smaller than oneself , Not primes
if(i%j==0)
break;
}
{
if(j==i)
printf("%d ",i);
}
}
return 0;
}
边栏推荐
- 全面理解Volatile关键字
- Analyze in detail the PBOT mining virus family behavior and the principle of exploited vulnerabilities, and provide detailed protection suggestions for the blue army
- 在实践中学习Spark计算框架(01)
- 1146 topological order (25 points)
- Recyclerview universal adapter package
- 2019.11.13 training summary
- Analysis of reentrantlock source code of AQS
- 云主机端口扫描
- Serpentine filling number
- IIS server related error
猜你喜欢

Comprehensive understanding of synchronized

Dev使用过程中的基本操作

CLR via C reading notes - loading and AppDomain

C#中Attribute(特性)

QGIS mapping

Downloading and installing VMware (basic idea + detailed process)

Basic operations during dev use

Seaweedfs security configuration

攻防世界-Re-insfsay

给定两个整形变量的值,将两个值的内容进行交换 (C语言)
随机推荐
《CLR via C#》读书笔记-CLR寄宿与AppDomain
Learn spark computing framework in practice (00)
《CLR via C#》读书笔记-单实例应用程序
Linux下Redis安装及集群搭建
這個開源項目超哇塞,手寫照片在線生成
Real time value transfer from C form to another form
mysql 8.0 一条insert语句的具体执行流程分析(二)
1098 insertion or heap sort (25 points)
Bug的描述、定级、生命周期
Substring score - Ultra detailed version - the last programming challenge
C#中IEqualityComparer接口的实现
1099 build a binary search tree (30 points)
Comprehensive understanding of synchronized
Is it safe to open a stock account with the QR code given by the manager of a securities firm? I want to open an account
Summary after the 2009 ICPC Shanghai regional competition
Text of the basic component of the shutter
L2-3 is this a binary search tree- The explanation is wonderful
全面理解Synchronized
Is it safe to open a securities account? Is it reliable?
Slide the custom control to close the activity control