Developer community
0 votes
3.2k views
asked by Geek (15.3k points) 17 42 62 | 3.2k views

1 Answer

0 votes

 

#include<stdio.h>

#include<conio.h>

void main()

{

int i,j;

clrscr();

printf(“the prime numbers are:\n”);

for(i=100;i<=500;i++)

{

for(j=2;j<i;j++)

{

if(i%j==0)

break;

}

if(i==j)

printf(“%d\t”,i);

}

getch();

}

Output:

the prime numbers are:

101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 

answered by Guru (39.1k points) 10 22 35

Related questions

0 votes
0 answers
asked by sara Guru (24.6k points) 29 52 82 | 74 views
0 votes
1 answer
asked by keem Expert (13.2k points) 27 42 59 | 52 views
0 votes
1 answer
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

3,751 questions
4,046 answers
117 comments
10,709 users