(adsbygoogle = window.adsbygoogle || []).push({}); Wanted help in c++ !!

Program to print the number of prime numbers between two user given numbers.

MY ATTEMPT TO SOLUTION :

I hv found how to print the prime numbers between two given numbers but couldn't print the number of prime numbers between two given numbers.

#include<iostream.h>

#include<conio.h>

void main()

{

int n,x,i,j;

cout<<"Enter the lower range";

cin>>n;

cout<<"Enter the upper range";

cin>>x;

for(i = n;i<=x;i++)

{

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

{

if(i % j !== 0)

{

cout<<i;

cout<<"\n";

}

}

}

getch();

}

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Wanted help in c++

**Physics Forums | Science Articles, Homework Help, Discussion**