1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Orlov [11]
3 years ago
7

C program to generate prime numbers from 1 to 100.Also count prime numbers. ​

Mathematics
1 answer:
Musya8 [376]3 years ago
8 0

Answer:

Step-by-step explanation:

#include <stdio.h>

int main()

{

  int num1, num2, flag_var, i, j;

 

  /* Ask user to input the from/to range

   * like 1 to 100, 10 to 1000 etc.

   */

  printf("Enter two range(input integer numbers only):");

  //Store the range in variables using scanf

  scanf("%d %d", &num1, &num2);

 

  //Display prime numbers for input range

  printf("Prime numbers from %d and %d are:\n", num1, num2);

  for(i=num1+1; i<num2; ++i)

  {

     flag_var=0;

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

     {

        if(i%j==0)

        {

           flag_var=1;

           break;

        }

     }

     if(flag_var==0)

        printf("%d\n",i);

 }

 return 0;

}

You might be interested in
3x = 9 what is the answer​
Alex_Xolod [135]

Answer:

3

Step-by-step explanation:

3x=9

Divide 3 from both sides to simplify

x=3

5 0
3 years ago
Read 2 more answers
What is the area of the figure shown below?
strojnjashka [21]

let us draw a line as shown in picture.

Now the area of large rectangle is

(A1) =1.3×1.8=2.34 sq. Km

and the area of small rectangle is

(A2)=1×0.65=0.65 sq. Km

therefore, the area of given figure is

A=A1-A2

=2.34-0.65

=1.69 sq. Km

3 0
3 years ago
Compare the values of the underlined digits. <br> 2,000 and 200
Pepsi [2]
Wats the underlined digit
4 0
3 years ago
HELP FAST PLEASE!!
stira [4]
I think it is B. and C.
secx = 3 and tanx = 3
Hope it helps
3 0
3 years ago
Read 2 more answers
Help me please I will give point to all
lapo4ka [179]

Answer:

try A if wrong try D

Step-by-step explanation:

this shold work

6 0
3 years ago
Other questions:
  • mrs. West took her class on a field trip to the museum cost of admission for the girls was $90 and the cost of admission for the
    12·2 answers
  • Simplify the expression. Write the answer using scientific notation. (4 x 10^13)^-2 -8 x 10^-26 6.25 x 10^-27 0.0625 x 10^-26 6.
    9·2 answers
  • PROBLEM 6
    6·1 answer
  • Find the value of the y when 5y + 45 = 100
    8·2 answers
  • Sun Country Bus Lines has 80,000 shares of stock outstanding.
    15·2 answers
  • What is the median of the data set 10,7,9,9,4, 6?
    6·1 answer
  • Does anyone know how to do this
    6·1 answer
  • yuri wrote twice as many poems as xenia. yuri wrote 3 more poems than xenia. the number of poems written can be represented by t
    11·1 answer
  • Someone that's good at 3.14 pie help ????
    15·1 answer
  • HELP ME PLZZZ!!!!!!!!!!!!!
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!