Computer Science, asked by Alwin3680, 1 year ago

Write a program that displays all the prime numbers between 50 and 100

Answers

Answered by faisal45
1
means I should write all prime numbers between 50 and 100
Answered by Ammustic007
0
1. #include <stdafx.h>

2. 
#include "genlib.h"

3. 
#include "simpio.h"

4. #include "math.h"

5.

6.

7. 
int _tmain(int argc, _TCHAR* argv[])

8.
{

9.            
int i,nam,lim;

10.          
for (i=50;1<=100;i++)

11. 
          {

12.         
nam=i;

13.           
}

14.         
 lim=sqrt((double)i)+1;

15.          
for (i=50;i<=lim;i+=2)

16.         
{

17.         
 printf("%d",i);
 
18.          
}

19.
}




:)
Similar questions